Any Command (CMD)

Last modified 07 Sep 2022 03:49 +02:00


Provisioning works well. Synchronization is not tested, but LiveSync is not supported.

Recommended connector

CMD Connector

The ConnID CMD Connector can be used to execute any commands using scripts. The following steps describe setup for creating directories with custom permissions on Linux server.

Resource Configuration

Directory /tmp/homedirs is assumed to exist. If you wish to use another directory, please modify the resource sample and be sure you have permissions for that directory (read/write).

The Groovy scripts implementing the operations are stored in samples/resources/cmd/*.sh. The scripts must be executable and need to be referenced from the resource:

  • implements the create operation (account is assumed to be a directory)

  • DeleteScript.groovy: implements the delete operation (account is assumed to be a directory) - not used now

  • implements the search/get operation (account is assumed to be a directory)

  • implements the test connection operation

  • implements the update operation (account is assumed to be a directory)

You can make modifications to the samples as needed.

CMD Connector does not support schema, so the schema with capabilities is statically defined in the resource sample. Make modifications there and in the shell scripts.

Omitting script from resource configurationProperties will cause the connector to not support that operation. Please update the capabilities as well.

The configuration above and in the samples provides the following features:

  • creating directory with chosen permissions as the projection of user in midPoint

  • update the homedirectory permissions

The only attributes configured for "accounts" (directories) are:

  • icfs:uid (readonly, the value is equal to icfs:name)

  • icfs:name (the directory name, outbound mapping is defined to concat /tmp/homedirs/ and user name from midPoint)

  • permissions (octal file permissions as in chmod, e.g. 755)

Sample resource can be imported from samples/resources/cmd/*.xml.

Connector Configuration

Connector Configuration Example


            <!-- Configuration specific for the CMD connector -->
            <!-- Please create /tmp/homedirs directory before testing of update the scripts -->
<!-- Renaming / changing __UID__ (__NAME__ == __UID__) not supported by CMD connector -->
<!--                                <connidcmd:deleteCmdPath>/opt/midpoint.home-master-node1/scripts/cmd-sample/</connidcmd:deleteCmdPath>-->


            <!-- Generic ICF configuration -->


            <!-- CMD connector does not support schema -->
         <xsd:schema xmlns:xsd=""
            <xsd:import namespace=""/>
            <xsd:import namespace=""/>
            <xsd:import namespace=""/>
            <xsd:complexType name="AccountObjectClass">
                  <xsd:element minOccurs="0" ref="icfs:uid">
                           <a:displayName>ICF UID</a:displayName>
                  <xsd:element ref="icfs:name">
                           <a:displayName>ICF NAME</a:displayName>
          <xsd:element minOccurs="1" maxOccurs="1" name="permissions" type="xsd:string">
      <native xmlns:cap="">
<!--         <cap:delete/>-->
<!--         <cap:script>-->
<!--            <cap:host>-->
<!--               <cap:type>resource</cap:type>-->
<!--            </cap:host>-->
<!--            <cap:host>-->
<!--               <cap:type>connector</cap:type>-->
<!--            </cap:host>-->
<!--         </cap:script>-->

Resource Sample

See resource samples and shell implementation scripts in Git samples directory for CMD connector (master).