Powershell connector and ForceSyncOf parameter.

I have implemented Powershell connector for the target system and I need an extended set of account attributes, not just altered ones, to call the Update method. In the ForceSyncOf parameter I have specified list of all necessary attributes but the connector used only changed ones. Is there may be an error or PS-connectors use its own logic and ignore ForceSyncOf?

Parents
  • Did you set those properties as mandatory in the schema xml?
    <Property Name="Email" DataType="String" IsMandatory="true">

  • Hi 
    Thanks for the advice.
    I have set the property IsMandatory="true" for the attributes required by the function "Update" of the PS-connector module, but the result is the same. Only the changed attributes are passed to function. That is, unchanged ones (like UNSAccountB.CCC_Email ...) are not passed despite their presence in the ForceSyncOf list (i.e. Value="CCC_Email") and the IsMandatory property. So I have to first read the object from the target system to get all the attributes.
    As far as I can see, the PS-connector only takes the changes received in the object, although I may be wrong.

    VI.Projector.Powershell.Connector.PoshConnectorBase.ExecuteMethod(
        PoshContext ctx,
        PoshSystemObjectData entity,
        string method // here "Update"
    )
    {
        //...
        List<SystemObjectDataModification> modifications = entity.GetModifications(
            SystemObjectDataModificationCompression.MatchingAddsAndRemoves,  // <===== ???
            true
        )
        foreach (IPSCommandSequenceItem command in methodConfiguration.CommandSequence) {
            int count = modifications.Count;
            modifications = command.ApplyModificationsToCommand(method, modifications, nativeClass, ctx.Runner);
            if (count != modifications.Count && count != 0 || command.Condition != PSCommandSequenceItemCondition.ModificationExists) {
                ctx.RunCommand(command, /* ... */);
                //...
            }
        }
    }


    Many thanks.
    Aleksandr

  • Hello Aleksandr,

    Two more things to check

    1: Remove (Condition="ModificationExists") from schema schema XML if present.

     <MethodConfiguration>
      <Method Name="Update">
              <CommandSequence>
                <Item Command="Set-Something" Order="1" Condition="ModificationExists"  />

    (The Condition "ModificationExisits" causes, that this command is only executed, if one or more propert(ies) were set, that are written by this command.)

    2: Check if ForceSyncOf is present as parameter of the AdHocProjection job
    Parameters:
    Key                        Value
    ForceSyncOf        CCC_Prop1,CCC_Prop2,CCC_Prop3

  • Niels,

    I have checked that:

    1) the Condition="ModificationExists" is not used in the descriptor of method Update

    2) attribute mapping in synchronization project is correct

    3) CausingEntityPatch contains entry for CCC_Email attribute/column with actual value

    4) step parameter ForceSyncOf is activated and is visible in process:

    <p>2021-05-28 12:18:32 +03:00 - \1IM-DEV - Process step parameter e2766462-17c4-4eef-a992-aedcb8a8ec90:
    [Job]
    	ComponentAssembly=VI.Projector.JobComponent
    	ComponentClass=VI.Projector.JobComponent.ProjectorComponent
    	Task=AdHocProjection
    	Executiontype=EXTERNAL
    [Parameters]
    	AuthenticationString=Hidden
    	CausingEntityPatch=Hidden
    	ConnectionProvider=VI.DB.ViSqlFactory,VI.DB
    	ConnectionString=Hidden
    	ForceSyncOf=CCC_Email
    	ProcID=5784f822-582a-47a7-8b7a-141008b7ada7
    	UID_DPRProjectionConfiguration=CCC-317AFA1EBD5BF44E850BFED5978484B8
    	UID_DPRSystemVariableSet=CCC-C5B12E3365C35C4893EFA0FDD75A0E23
    

    Is there a way to ensure that the PS-connector can pass unchanged attributes and under what conditions?
    (I use One Identity Manager v.8.1)

    Thank you for your help.

  • Yes, but it is a little big.

    <?xml version="1.0" encoding="utf-8"?>
    <PowershellConnectorDefinition Id="B2Connector" Description="B2 connector" Version="1.0">
        <PluginAssemblies />
        <ConnectionParameters>
            <ConnectionParameter Name="Module"     Description="Module" />
            <ConnectionParameter Name="Hostname"   Description="Hostname" />
            <ConnectionParameter Name="Port"       Description="Port" />
            <ConnectionParameter Name="Service"    Description="Service" />
            <ConnectionParameter Name="Login"      Description="Login" />
            <ConnectionParameter Name="Password"   Description="Password" IsSensibleData="true" />
            <ConnectionParameter Name="UserFilter" Description="User filter" />
        </ConnectionParameters>
        <Initialization>
            <PredefinedCommands>
                <Command Name="Set-B2UserFilter" />
                <Command Name="Connect-B2" />
                <Command Name="Disconnect-B2" />
                <Command Name="Get-B2Tobo" />
                <Command Name="Get-B2ToboSet" />
                <Command Name="Get-B2Department" />
                <Command Name="Get-B2AccessRole" />
                <Command Name="Get-B2DealGroup" />
                <Command Name="Get-B2CashRole" />
                <Command Name="Get-B2Group" />
                <Command Name="Get-B2AccountGroup" />
                <Command Name="Get-B2User" />
                <Command Name="Get-B2UserGroup" />
                <Command Name="Get-B2UserAccountGroup" />
                <Command Name="New-B2User" />
                <Command Name="Set-B2User" />
                <Command Name="Add-B2UserGroup" />
                <Command Name="Revoke-B2UserGroupById" />
                <Command Name="Add-B2UserAccountGroup" />
                <Command Name="Revoke-B2UserAccountGroupById" />
             </PredefinedCommands>
            <CustomCommands>
                <CustomCommand Name="Import-ConnectorModule">
                    <![CDATA[
                        param($Module)
                        Import-Module -DisableNameChecking -Force $Module
                    ]]>
                </CustomCommand>
                <CustomCommand Name="Connect-TargetSystem">
                    <![CDATA[
                        param($Hostname, $Port, $Service, $Login, $Password, $UserFilter)
                        $global:con = Connect-B2 $Hostname $Port $Service $Login $Password
                        Set-B2UserFilter $UserFilter
                    ]]>
                </CustomCommand>
            </CustomCommands>
            <EnvironmentInitialization>
                <Connect>
                    <CommandSequence>
                        <Item Command="Import-ConnectorModule" Order="1">
                            <SetParameter Param="Module" Source="ConnectionParameter" Value="Module" />
                        </Item>
                        <Item Command="Connect-TargetSystem" Order="2">
                            <SetParameter Param="Hostname"   Source="ConnectionParameter" Value="Hostname" />
                            <SetParameter Param="Port"       Source="ConnectionParameter" Value="Port" />
                            <SetParameter Param="Service"    Source="ConnectionParameter" Value="Service" />
                            <SetParameter Param="Login"      Source="ConnectionParameter" Value="Login" />
                            <SetParameter Param="Password"   Source="ConnectionParameter" Value="Password" />
                            <SetParameter Param="UserFilter" Source="ConnectionParameter" Value="UserFilter" />
                        </Item>
                    </CommandSequence>
                </Connect>
                <Disconnect>
                    <CommandSequence>
                        <Item Command="Disconnect-B2" Order="1" />
                    </CommandSequence>
                </Disconnect>
            </EnvironmentInitialization>
        </Initialization>
        <Schema>
            <Class Name="Tobo">
                <Properties>
                    <Property Name="id" DataType="String" IsUniqueKey="true" IsMandatory="true" IsAutoFill="true">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2Tobo" Path="id.ToString()" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="Get-B2Tobo" Parameter="id" />
                        </CommandMappings>
                    </Property>
                    <Property Name="sname" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2Tobo" Path="sname" />
                        </ReturnBindings>
                    </Property>
                </Properties>
                <ReadConfiguration>
                    <ListingCommand Command="Get-B2Tobo">
                        <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                    </ListingCommand>
                    <CommandSequence>
                        <Item Command="Get-B2Tobo" Order="1">
                            <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                        </Item>
                    </CommandSequence>
                </ReadConfiguration>
            </Class>
            <Class Name="ToboSet">
                <Properties>
                    <Property Name="id" DataType="String" IsUniqueKey="true" IsMandatory="true" IsAutoFill="true">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2ToboSet" Path="id.ToString()" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="Get-B2ToboSet" Parameter="id" />
                        </CommandMappings>
                    </Property>
                    <Property Name="sname" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2ToboSet" Path="sname" />
                        </ReturnBindings>
                    </Property>
                    <Property Name="description" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2ToboSet" Path="description" />
                        </ReturnBindings>
                    </Property>
                </Properties>
                <ReadConfiguration>
                    <ListingCommand Command="Get-B2ToboSet">
                        <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                    </ListingCommand>
                    <CommandSequence>
                        <Item Command="Get-B2ToboSet" Order="1">
                            <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                        </Item>
                    </CommandSequence>
                </ReadConfiguration>
            </Class>
            <Class Name="Department">
                <Properties>
                    <Property Name="id" DataType="String" IsUniqueKey="true" IsMandatory="true" IsAutoFill="true">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2Department" Path="id.ToString()" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="Get-B2Department" Parameter="id" />
                        </CommandMappings>
                    </Property>
                    <Property Name="sname" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2Department" Path="sname" />
                        </ReturnBindings>
                    </Property>
                    <Property Name="name" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2Department" Path="name" />
                        </ReturnBindings>
                    </Property>
                    <Property Name="parentid" DataType="String" >
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2Department" Path="parentid.ToString()" />
                        </ReturnBindings>
                    </Property>
                </Properties>
                <ReadConfiguration>
                    <ListingCommand Command="Get-B2Department">
                        <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                    </ListingCommand>
                    <CommandSequence>
                        <Item Command="Get-B2Department" Order="1">
                            <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                        </Item>
                    </CommandSequence>
                </ReadConfiguration>
            </Class>
            <Class Name="AccessRole">
                <Properties>
                    <Property Name="id" DataType="String" IsUniqueKey="true" IsMandatory="true" IsAutoFill="true">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2AccessRole" Path="id.ToString()" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="Get-B2AccessRole" Parameter="id" />
                        </CommandMappings>
                    </Property>
                    <Property Name="rolename" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2AccessRole" Path="rolename" />
                        </ReturnBindings>
                    </Property>
                </Properties>
                <ReadConfiguration>
                    <ListingCommand Command="Get-B2AccessRole">
                        <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                    </ListingCommand>
                    <CommandSequence>
                        <Item Command="Get-B2AccessRole" Order="1">
                            <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                        </Item>
                    </CommandSequence>
                </ReadConfiguration>
            </Class>
            <Class Name="DealGroup">
                <Properties>
                    <Property Name="id" DataType="String" IsUniqueKey="true" IsMandatory="true" IsAutoFill="true">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2DealGroup" Path="id.ToString()" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="Get-B2DealGroup" Parameter="id" />
                        </CommandMappings>
                    </Property>
                    <Property Name="name" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2DealGroup" Path="name" />
                        </ReturnBindings>
                    </Property>
                    <Property Name="description" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2DealGroup" Path="description" />
                        </ReturnBindings>
                    </Property>
                </Properties>
                <ReadConfiguration>
                    <ListingCommand Command="Get-B2DealGroup">
                        <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                    </ListingCommand>
                    <CommandSequence>
                        <Item Command="Get-B2DealGroup" Order="1">
                            <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                        </Item>
                    </CommandSequence>
                </ReadConfiguration>
            </Class>
            <Class Name="CashRole">
                <Properties>
                    <Property Name="id" DataType="String" IsUniqueKey="true" IsMandatory="true" IsAutoFill="true">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2CashRole" Path="id.ToString()" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="Get-B2CashRole" Parameter="id" />
                        </CommandMappings>
                    </Property>
                    <Property Name="sname" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2CashRole" Path="sname" />
                        </ReturnBindings>
                    </Property>
                    <Property Name="description" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2CashRole" Path="description" />
                        </ReturnBindings>
                    </Property>
                </Properties>
                <ReadConfiguration>
                    <ListingCommand Command="Get-B2CashRole">
                        <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                    </ListingCommand>
                    <CommandSequence>
                        <Item Command="Get-B2CashRole" Order="1">
                            <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                        </Item>
                    </CommandSequence>
                </ReadConfiguration>
            </Class>
            <Class Name="Group">
                <Properties>
                    <Property Name="id" DataType="String" IsUniqueKey="true" IsMandatory="true" IsAutoFill="true">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2Group" Path="id.ToString()" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="Get-B2Group" Parameter="id" />
                        </CommandMappings>
                    </Property>
                    <Property Name="name" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2Group" Path="name" />
                        </ReturnBindings>
                    </Property>
                    <Property Name="description" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2Group" Path="description" />
                        </ReturnBindings>
                    </Property>
                </Properties>
                <ReadConfiguration>
                    <ListingCommand Command="Get-B2Group">
                        <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                    </ListingCommand>
                    <CommandSequence>
                        <Item Command="Get-B2Group" Order="1">
                            <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                        </Item>
                    </CommandSequence>
                </ReadConfiguration>
            </Class>
            <Class Name="AccountGroup">
                <Properties>
                    <Property Name="id" DataType="String" IsUniqueKey="true" IsMandatory="true" IsAutoFill="true">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2AccountGroup" Path="id.ToString()" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="Get-B2AccountGroup" Parameter="id" />
                        </CommandMappings>
                    </Property>
                    <Property Name="name" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2AccountGroup" Path="name" />
                        </ReturnBindings>
                    </Property>
                    <Property Name="description" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2AccountGroup" Path="description" />
                        </ReturnBindings>
                    </Property>
                </Properties>
                <ReadConfiguration>
                    <ListingCommand Command="Get-B2AccountGroup">
                        <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                    </ListingCommand>
                    <CommandSequence>
                        <Item Command="Get-B2AccountGroup" Order="1">
                            <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                        </Item>
                    </CommandSequence>
                </ReadConfiguration>
            </Class>
            <Class Name="User">
                <Properties>
                    <Property Name="id" DataType="String" IsUniqueKey="true" IsMandatory="true" IsAutoFill="true">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="id.ToString()" />
                            <Bind CommandResultOf="New-B2User" Path="id.ToString()" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="Get-B2User" Parameter="id" />
                            <Map ToCommand="Set-B2User" Parameter="id" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="aacsesstypeid" DataType="Int">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="aacsesstypeid" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="aacsesstypeid" />
                            <Map ToCommand="Set-B2User" Parameter="aacsesstypeid" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="accaccessmodecode" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="accaccessmodecode" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="accaccessmodecode" />
                            <Map ToCommand="Set-B2User" Parameter="accaccessmodecode" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="auth2level" DataType="Int">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="auth2level" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="auth2level" />
                            <Map ToCommand="Set-B2User" Parameter="auth2level" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="bookbydeptonly" DataType="Int">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="bookbydeptonly" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="bookbydeptonly" />
                            <Map ToCommand="Set-B2User" Parameter="bookbydeptonly" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="checkmsginterval" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="checkmsginterval.ToString()" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="checkmsginterval" />
                            <Map ToCommand="Set-B2User" Parameter="checkmsginterval" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="check_change_mode" DataType="Int">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="check_change_mode" />
                        </ReturnBindings>
                    </Property>
                    <Property Name="currentroleid" DataType="String">
                        <ReferenceTargets>
                            <ReferenceTarget Class="CashRole" Property="id"/>
                        </ReferenceTargets>
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="currentroleid.ToString()" />
                        </ReturnBindings>
                    </Property>
                    <Property Name="datelastlogin" DataType="DateTime">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="datelastlogin" />
                        </ReturnBindings>
                    </Property>
                    <Property Name="deletedocsmode" DataType="Int">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="deletedocsmode" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="deletedocsmode" />
                            <Map ToCommand="Set-B2User" Parameter="deletedocsmode" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="departmentid" DataType="String">
                        <ReferenceTargets>
                            <ReferenceTarget Class="Department" Property="id"/>
                        </ReferenceTargets>
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="departmentid.ToString()" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="departmentid" />
                            <Map ToCommand="Set-B2User" Parameter="departmentid" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="docavaildepartment" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="docavaildepartment" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="docavaildepartment" />
                            <Map ToCommand="Set-B2User" Parameter="docavaildepartment" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="email" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="email" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="email" />
                            <Map ToCommand="Set-B2User" Parameter="email" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="firstname" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="firstname" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="firstname" />
                            <Map ToCommand="Set-B2User" Parameter="firstname" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="hierarchylevel" DataType="Int">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="hierarchylevel" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="hierarchylevel" />
                            <Map ToCommand="Set-B2User" Parameter="hierarchylevel" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="isldapauth" DataType="Int">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="isldapauth" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="isldapauth" />
                            <Map ToCommand="Set-B2User" Parameter="isldapauth" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="job" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="job" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="job" />
                            <Map ToCommand="Set-B2User" Parameter="job" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="lastname" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="lastname" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="lastname" />
                            <Map ToCommand="Set-B2User" Parameter="lastname" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="ldapusername" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="ldapusername" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="ldapusername" />
                            <Map ToCommand="Set-B2User" Parameter="ldapusername" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="logindisabled" DataType="Int">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="logindisabled" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="logindisabled" />
                            <Map ToCommand="Set-B2User" Parameter="logindisabled" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="loginfromonecomponly" DataType="Int">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="loginfromonecomponly" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="loginfromonecomponly" />
                            <Map ToCommand="Set-B2User" Parameter="loginfromonecomponly" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="maindepartmentid" DataType="String">
                        <ReferenceTargets>
                            <ReferenceTarget Class="Department" Property="id"/>
                        </ReferenceTargets>
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="maindepartmentid.ToString()" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="maindepartmentid" />
                            <Map ToCommand="Set-B2User" Parameter="maindepartmentid" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="maindocavaildepartment" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="maindocavaildepartment" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="maindocavaildepartment" />
                            <Map ToCommand="Set-B2User" Parameter="maindocavaildepartment" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="maintoboid" DataType="String">
                        <ReferenceTargets>
                            <ReferenceTarget Class="Tobo" Property="id"/>
                        </ReferenceTargets>
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="maintoboid.ToString()" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="maintoboid" />
                            <Map ToCommand="Set-B2User" Parameter="maintoboid" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="middlename" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="middlename" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="middlename" />
                            <Map ToCommand="Set-B2User" Parameter="middlename" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="mobilephone" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="mobilephone" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="mobilephone" />
                            <Map ToCommand="Set-B2User" Parameter="mobilephone" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="modifydocsmode" DataType="Int">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="modifydocsmode" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="modifydocsmode" />
                            <Map ToCommand="Set-B2User" Parameter="modifydocsmode" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="password" DataType="String" AccessConstraint="WriteOnly">
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="password" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="personnumber" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="personnumber" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="personnumber" />
                            <Map ToCommand="Set-B2User" Parameter="personnumber" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="phone" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="phone" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="phone" />
                            <Map ToCommand="Set-B2User" Parameter="phone" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="roleusername" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="roleusername" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="roleusername" />
                            <Map ToCommand="Set-B2User" Parameter="roleusername" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="signaturedocsmode" DataType="Int">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="signaturedocsmode" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="signaturedocsmode" />
                            <Map ToCommand="Set-B2User" Parameter="signaturedocsmode" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="siteid" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="siteid.ToString()" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="siteid" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="toboid" DataType="String">
                        <ReferenceTargets>
                            <ReferenceTarget Class="Tobo" Property="id"/>
                        </ReferenceTargets>
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="toboid.ToString()" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="toboid" />
                            <Map ToCommand="Set-B2User" Parameter="toboid" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="ac_tobosetid" DataType="String">
                        <ReferenceTargets>
                            <ReferenceTarget Class="ToboSet" Property="id"/>
                        </ReferenceTargets>
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="ac_tobosetid.ToString()" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="ac_tobosetid" />
                            <Map ToCommand="Set-B2User" Parameter="ac_tobosetid" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="transactaccesstypeid" DataType="Int">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="transactaccesstypeid" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="transactaccesstypeid" />
                            <Map ToCommand="Set-B2User" Parameter="transactaccesstypeid" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="unbookdocsmode" DataType="Int">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="unbookdocsmode" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="unbookdocsmode" />
                            <Map ToCommand="Set-B2User" Parameter="unbookdocsmode" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="userdealgroupid" DataType="String">
                        <ReferenceTargets>
                            <ReferenceTarget Class="DealGroup" Property="id"/>
                        </ReferenceTargets>
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="userdealgroupid.ToString()" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="userdealgroupid" />
                            <Map ToCommand="Set-B2User" Parameter="userdealgroupid" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="username" DataType="String" >
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2User" Path="username" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="New-B2User" Parameter="username" />
                            <Map ToCommand="Set-B2User" Parameter="username" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="New-B2User" />
                            <ModBy Command="Set-B2User" />
                        </ModifiedBy>
                    </Property>
                </Properties>
                <ReadConfiguration>
                    <ListingCommand Command="Get-B2User">
                        <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                    </ListingCommand>
                    <CommandSequence>
                        <Item Command="Get-B2User" Order="1">
                            <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                        </Item>
                    </CommandSequence>
                </ReadConfiguration>
                <MethodConfiguration>
                    <Method Name="Insert">
                        <CommandSequence>
                            <Item Command="New-B2User" Order="1">
                                <SetParameter Param="con" Source="GlobalVariable" Value="con"/>
                            </Item>
                        </CommandSequence>
                    </Method>
                    <Method Name="Update">
                        <CommandSequence>
                            <Item Command="Set-B2User" Order="1" >
                                <SetParameter Param="con" Source="GlobalVariable" Value="con"/>
                            </Item>
                        </CommandSequence>
                    </Method>
                </MethodConfiguration>
            </Class>
            <Class Name="UserGroup">
                <Properties>
                    <Property Name="id" DataType="String" IsUniqueKey="true" IsMandatory="true" IsAutoFill="true">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2UserGroup" Path="id" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="Get-B2UserGroup" Parameter="id" />
                            <Map ToCommand="Revoke-B2UserGroupById" Parameter="id" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="Revoke-B2UserGroupById" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="userid" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2UserGroup" Path="userid.ToString()" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="Add-B2UserGroup" Parameter="userid" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="Add-B2UserGroup" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="groupid" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2UserGroup" Path="usergroupid.ToString()" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="Add-B2UserGroup" Parameter="groupid" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="Add-B2UserGroup" />
                        </ModifiedBy>
                    </Property>
                </Properties>
                <ReadConfiguration>
                    <ListingCommand Command="Get-B2UserGroup">
                        <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                    </ListingCommand>
                    <CommandSequence>
                        <Item Command="Get-B2UserGroup" Order="1">
                            <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                        </Item>
                    </CommandSequence>
                </ReadConfiguration>
                <MethodConfiguration>
                    <Method Name="Insert">
                        <CommandSequence>
                            <Item Command="Add-B2UserGroup" Order="1">
                                <SetParameter Param="con" Source="GlobalVariable" Value="con"/>
                            </Item>
                        </CommandSequence>
                    </Method>
                    <Method Name="Delete">
                        <CommandSequence>
                            <Item Command="Revoke-B2UserGroupById" Order="1">
                                <SetParameter Param="con" Source="GlobalVariable" Value="con"/>
                            </Item>
                        </CommandSequence>
                    </Method>
                </MethodConfiguration>
            </Class>
            <Class Name="UserAccountGroup">
                <Properties>
                    <Property Name="id" DataType="String" IsUniqueKey="true" IsMandatory="true" IsAutoFill="true">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2UserAccountGroup" Path="id" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="Get-B2UserAccountGroup" Parameter="id" />
                            <Map ToCommand="Revoke-B2UserAccountGroupById" Parameter="id" />
                        </CommandMappings>
                    </Property>
                    <Property Name="userid" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2UserAccountGroup" Path="userid.ToString()" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="Add-B2UserAccountGroup" Parameter="userid" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="Add-B2UserAccountGroup" />
                        </ModifiedBy>
                    </Property>
                    <Property Name="groupid" DataType="String">
                        <ReturnBindings>
                            <Bind CommandResultOf="Get-B2UserAccountGroup" Path="useraccgroupid.ToString()" />
                        </ReturnBindings>
                        <CommandMappings>
                            <Map ToCommand="Add-B2UserAccountGroup" Parameter="groupid" />
                        </CommandMappings>
                        <ModifiedBy>
                            <ModBy Command="Add-B2UserAccountGroup" />
                        </ModifiedBy>
                    </Property>
                </Properties>
                <ReadConfiguration>
                    <ListingCommand Command="Get-B2UserAccountGroup">
                        <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                    </ListingCommand>
                    <CommandSequence>
                        <Item Command="Get-B2UserAccountGroup" Order="1">
                            <SetParameter Param="con" Source="GlobalVariable" Value="con" />
                        </Item>
                    </CommandSequence>
                </ReadConfiguration>
                <MethodConfiguration>
                    <Method Name="Insert">
                        <CommandSequence>
                            <Item Command="Add-B2UserAccountGroup" Order="1">
                                <SetParameter Param="con" Source="GlobalVariable" Value="con"/>
                            </Item>
                        </CommandSequence>
                    </Method>
                    <Method Name="Delete">
                        <CommandSequence>
                            <Item Command="Revoke-B2UserAccountGroupById" Order="1">
                                <SetParameter Param="con" Source="GlobalVariable" Value="con"/>
                            </Item>
                        </CommandSequence>
                    </Method>
                </MethodConfiguration>
            </Class>
        </Schema>
    </PowershellConnectorDefinition>
    

    P.S. In this version of descriptor IsMandatory not used because it has no effect.

  • Looks good to me.

    If you want to be sure that the forcesync parameters are really passed through or not
    remove the "Set-B2User" from <PredefinedCommands> and add this function.

    <CustomCommand Name="Set-B2User">
    <![CDATA[
    param (
    [Parameter(Mandatory=$true)]
    [string]$id,

    [Parameter(Mandatory=$false)]
    [string]$email,

    [Parameter(Mandatory=$false)]
    [string]$firstname,

    [Parameter(Mandatory=$false)]
    [string]$lastname,

    [Parameter(Mandatory=$false)]
    [string]$username

    ...complete for all parameters
    )
    $body = @{}
    $parameters = $MyInvocation.BoundParameters

    if ($parameters.ContainsKey("id")) {
    $body.id = $id
    }
    if ($parameters.ContainsKey("email")) {
    $body.email = $email
    }
    if ($parameters.ContainsKey("lastname")) {
    $body.lastname = $lastname
    }
    if ($parameters.ContainsKey("lastname")) {
    $body.lastname = $lastname
    }
    if ($parameters.ContainsKey("username")) {
    $body.username = $username
    }
    ...complete for all parameters

    $jsonBody = ConvertTo-Json -InputObject $body
    Throw $jsonBody
    ]]>

Reply
  • Looks good to me.

    If you want to be sure that the forcesync parameters are really passed through or not
    remove the "Set-B2User" from <PredefinedCommands> and add this function.

    <CustomCommand Name="Set-B2User">
    <![CDATA[
    param (
    [Parameter(Mandatory=$true)]
    [string]$id,

    [Parameter(Mandatory=$false)]
    [string]$email,

    [Parameter(Mandatory=$false)]
    [string]$firstname,

    [Parameter(Mandatory=$false)]
    [string]$lastname,

    [Parameter(Mandatory=$false)]
    [string]$username

    ...complete for all parameters
    )
    $body = @{}
    $parameters = $MyInvocation.BoundParameters

    if ($parameters.ContainsKey("id")) {
    $body.id = $id
    }
    if ($parameters.ContainsKey("email")) {
    $body.email = $email
    }
    if ($parameters.ContainsKey("lastname")) {
    $body.lastname = $lastname
    }
    if ($parameters.ContainsKey("lastname")) {
    $body.lastname = $lastname
    }
    if ($parameters.ContainsKey("username")) {
    $body.username = $username
    }
    ...complete for all parameters

    $jsonBody = ConvertTo-Json -InputObject $body
    Throw $jsonBody
    ]]>

Children
  • Hello Niels,

    I changed the Update procedure as you suggested me and got following results:

    Excerpt from entity patch:

    Entity: IDMTEST01 (B2)
       AccountDisabled: False           (AccountDisabled      <=> disabled)
       AccountName: IDMTEST01           (AccountName          <=> username)
       CCC_CustomProperty03: 28 => 29   (CCC_CustomProperty03 <=> checkmsginterval)
       CCC_Email: IdmTest01@mail.org    (CCC_Email            <=> email)
       CCC_Phone: 5550801 => 5550901    (CCC_Phone            <=> phone)
       FirstName: Idm                   (FirstName            <=> firstname)
       LastName: Test01                 (LastName             <=> lastname)
       ...
       UID_UNSAccountB: 20b6d17d-469e-4109-994c-346a71a11347 
       UID_UNSRootB: f7035c91-ee1b-4773-8e13-5845033970cd 
       XObjectKey: <Key><T>UNSAccountB</T><P>20b6d17d-469e-4109-994c-346a71a11347</P></Key> 
       XTouched:  
       XUserInserted: Synchronization 
       XUserUpdated: cccadmin

    Also excerpt from JobService.log:

    AdHocProjection
    	Executiontype=EXTERNAL
    [Parameters]
    	AuthenticationString=Hidden
    	CausingEntityPatch=Hidden
    	ConnectionProvider=VI.DB.ViSqlFactory,VI.DB
    	ConnectionString=Hidden
    	ForceSyncOf=FirstName,LastName,CCC_Email   // !!!
    	ProcID=b0c43bfc-a29d-4ae2-89ea-4a2829f0ddf2
    	UID_DPRProjectionConfiguration=CCC-317AFA1EBD5BF44E850BFED5978484B8
    	UID_DPRSystemVariableSet=CCC-C5B12E3365C35C4893EFA0FDD75A0E23
    ...
    <e>2021-05-31 17:19:03 +03:00 - \1IM-DEV - VI.Projector.JobComponent.ProjectorComponent - 6c553955-905e-4237-bfc9-c28a4aeda8f6: Errors occurred
        [1777018] Error executing synchronization project (B2)'s workflow (Provisioning).
        [1777124] Error executing projection step (User) of projection configuration (Provisioning (0b95bc77-fce3-49c2-bf5c-c2b293582b44)).
        [1777219] Error executing synchronization step (User)!
        [1777004] Method ( (Update)) could not be executed successfully.
        [System.Management.Automation.RuntimeException] 
        ---
        JsonBody
        {
            "checkmsginterval":  "29",
            "id":  "97396",
            "phone":  "5550901"
        }
        ---
        at VI.Projector.JobComponent.ProjectorComponent._AdHocProjection()

    I.e. PS-connector ignores unchanged attributes and ForceSyncOf parameter and passes to the procedure of PS-module only changed ones. This forces to prefetch objects (accounts) from the target systems before every update (if API of system requires the set of attributes to perform updates).

    Thanks,
    Aleksandr

  • I think I've found the issue: you did not specify the method for the properties on the <ModifiedBy> section.
    When you have 1 command this is not necessary, but with  2 commands you also need to set the "Method"

    <Class Name="User">
    ....

    Is:
    <ModifiedBy>
    <ModBy Command="New-B2User" />
    <ModBy Command="Set-B2User" />

    Change to:
    <ModifiedBy>
    <ModBy Command="Set-B2User" Method="Update"/>
    <ModBy Command="New-B2User" Method="Insert"/>

  • To avoid possible conflicts I removed entries like <ModBy Command="New-B2User"/> (initially it was an attempt to make possible the mapping for ReadAndInsertOnly attributes) and retained <ModBy Command="Set-B2User"/> entries only. Now the attribute descriptions are like this:

    <Property Name="username" DataType="String" IsMandatory="true">
        <ReturnBindings>
            <Bind CommandResultOf="Get-B2User" Path="username"/>
        </ReturnBindings>
        <CommandMappings>
            <Map ToCommand="New-B2DbUser" Parameter="username"/>
            <Map ToCommand="New-B2User"   Parameter="username"/>
            <Map ToCommand="Set-B2User"   Parameter="username"/>
        </CommandMappings>
        <ModifiedBy>
            <ModBy Command="Set-B2User"/>
        </ModifiedBy>
    </Property>
    

    (And ForseSyncOf contains all columns of UNSAccountB, which need to be passed on to connector, like Value="AccountName,LastName,FirstName,CCC_Email...")
    But no changes happened.
    Niels, do you have the possibility to test this case on some simpliest system with a PS-connector?

  • Hello, Niels.

    For testing purposes I have implemented simple PS-connector to Json-file, synchronization project and AdHoc-provisioniing process with convenient logging ) I would appreciate some further comments.

    https://github.com/syozh/1im-xyz

    Many thanks,
    Aleksandr

  • Hello Aleksandr,

    Nicely done! If tried it out on a 8.1.4 OOTB Installation and it works like a charm.

    Log: Update on Bob with generating condition (Value = True) instead of (Value = CBool(values("NeedExecute"))

    2021-06-05 19:30:03.9714 INFO (XyzProvisionLog ) : >> Process CCC_Xyz_Account_Provision: Event: UPDATE 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) : Connection variables: 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   GenProcID: 85dadf78-a15c-4ab8-b04c-cc11d82f50b3 
    2021-06-05 19:30:03.9714 DEBUG (XyzProvisionLog ) : Entity: Xyz/Bob Brown (Xyz) 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   AccountDisabled: False 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   AccountExpires: 12/30/1899 12:00:00 AM 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   AccountName: Bob 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   CanonicalName: Xyz/Bob Brown 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   cn: Bob Brown 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   Description: Vice-president 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   DisplayName: Xyz/Bob Brown (Xyz) 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   DistinguishedName: user=Bob Brown,system=Xyz 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   FirstName: Bob 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   IdentityType:  
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   IsGroupAccount: False 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   IsPrivilegedAccount: False 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   LastLogon: 12/30/1899 12:00:00 AM 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   LastName: Brown 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   MatchPatternForMembership: 0 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   MemberOf:  
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   ObjectGUID: c8932aad-4b86-469d-bd8f-2bf715c94448 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   Password: *** 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   PWDLastSet: 12/30/1899 12:00:00 AM 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   RiskIndexCalculated: 0.05 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   UID_Person:  
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   UID_TSBAccountDef:  
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   UID_TSBBehavior:  
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   UID_UNSAccountB: cc891d09-7433-4378-9873-a521329952e5 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   UID_UNSContainerB:  
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   UID_UNSRootB: 35dc1a72-ed10-421e-bca6-fa730d6fc43a 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   XDateInserted: 6/5/2021 6:45:14 AM 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   XDateUpdated: 6/5/2021 5:26:56 PM 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   XMarkedForDeletion: 0 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   XObjectKey: <Key><T>UNSAccountB</T><P>cc891d09-7433-4378-9873-a521329952e5</P></Key> 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   XTouched:  
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   XUserInserted: Synchronization 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   XUserUpdated: viadmin 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) : ObjectKey: <Key><T>UNSAccountB</T><P>cc891d09-7433-4378-9873-a521329952e5</P></Key> 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) : AdHocData: 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   ConnectionUID: CCC-6FF2F8A2B54AEE4EA03CF45BA9C9B198 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   VariableSetUID: CCC-A10985E7CE665640A5593A20AEA412C7 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   ExecutionServerUID: B3A90D04-819D-4082-9B30-5F880C1CDE29 
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   ExecutionServerTag:  
    2021-06-05 19:30:03.9714 TRACE (XyzProvisionLog ) :   ProjectionConfigUID: CCC-0962E299E0F2234AAC91F1D5FADEBEC4 
    2021-06-05 19:30:03.9714 INFO (XyzProvisionLog ) : NeedExecute: False 
    2021-06-05 19:30:18.7691 INFO (XyzConnectorLog ) : Connect-Xyz file=C:/1im-xyz-main/Xyz.json 
    2021-06-05 19:30:19.0944 INFO (XyzConnectorLog ) : Get-XyzAccount id=c8932aad-4b86-469d-bd8f-2bf715c94448 
    2021-06-05 19:30:19.0944 DEBUG (XyzConnectorLog ) :   > {"fname":"Bob","title":"Vice-president","disabled":"0","id":"c8932aad-4b86-469d-bd8f-2bf715c94448","lname":"Brown"} 
    2021-06-05 19:30:19.3184 INFO (XyzConnectorLog ) : Get-XyzAccount id=c8932aad-4b86-469d-bd8f-2bf715c94448 
    2021-06-05 19:30:19.3184 DEBUG (XyzConnectorLog ) :   > {"fname":"Bob","title":"Vice-president","disabled":"0","id":"c8932aad-4b86-469d-bd8f-2bf715c94448","lname":"Brown"} 
    2021-06-05 19:30:19.3894 INFO (XyzConnectorLog ) : Disconnect-Xyz 
    

    Log: Update on Bob changed title from Vice-president to President

    2021-06-05 19:40:55.7070 INFO (XyzProvisionLog ) : >> Process CCC_Xyz_Account_Provision: Event: UPDATE 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) : Connection variables: 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   GenProcID: 93eca0f5-0d18-4522-8927-8bea1638fbe4 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   QBMProduct: Manager 
    2021-06-05 19:40:55.7070 DEBUG (XyzProvisionLog ) : Entity: Xyz/Bob Brown (Xyz) 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   AccountDisabled: False 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   AccountExpires: 12/30/1899 12:00:00 AM 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   AccountName: Bob 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   CanonicalName: Xyz/Bob Brown 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   cn: Bob Brown 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   Description: Vice-president -> President 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   DisplayName: Xyz/Bob Brown (Xyz) 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   DistinguishedName: user=Bob Brown,system=Xyz 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   FirstName: Bob 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   IdentityType:  
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   IsGroupAccount: False 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   IsPrivilegedAccount: False 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   LastLogon: 12/30/1899 12:00:00 AM 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   LastName: Brown 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   MatchPatternForMembership: 0 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   MemberOf:  
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   ObjectGUID: c8932aad-4b86-469d-bd8f-2bf715c94448 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   Password: *** 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   PWDLastSet: 12/30/1899 12:00:00 AM 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   RiskIndexCalculated: 0.05 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   UID_Person:  
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   UID_TSBAccountDef:  
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   UID_TSBBehavior:  
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   UID_UNSAccountB: cc891d09-7433-4378-9873-a521329952e5 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   UID_UNSContainerB:  
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   UID_UNSRootB: 35dc1a72-ed10-421e-bca6-fa730d6fc43a 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   XDateInserted: 6/5/2021 6:45:14 AM 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   XDateUpdated: 6/5/2021 5:26:56 PM 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   XMarkedForDeletion: 0 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   XObjectKey: <Key><T>UNSAccountB</T><P>cc891d09-7433-4378-9873-a521329952e5</P></Key> 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   XTouched:  
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   XUserInserted: Synchronization 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   XUserUpdated: viadmin 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) : ObjectKey: <Key><T>UNSAccountB</T><P>cc891d09-7433-4378-9873-a521329952e5</P></Key> 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) : AdHocData: 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   ConnectionUID: CCC-6FF2F8A2B54AEE4EA03CF45BA9C9B198 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   VariableSetUID: CCC-A10985E7CE665640A5593A20AEA412C7 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   ExecutionServerUID: B3A90D04-819D-4082-9B30-5F880C1CDE29 
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   ExecutionServerTag:  
    2021-06-05 19:40:55.7070 TRACE (XyzProvisionLog ) :   ProjectionConfigUID: CCC-0962E299E0F2234AAC91F1D5FADEBEC4 
    2021-06-05 19:40:55.7070 INFO (XyzProvisionLog ) : NeedExecute: True 
    2021-06-05 19:41:19.6712 INFO (XyzConnectorLog ) : Connect-Xyz file=C:/1im-xyz-main/Xyz.json 
    2021-06-05 19:41:20.0192 INFO (XyzConnectorLog ) : Get-XyzAccount id=c8932aad-4b86-469d-bd8f-2bf715c94448 
    2021-06-05 19:41:20.0372 DEBUG (XyzConnectorLog ) :   > {"fname":"Bob","title":"Vice-president","disabled":"0","id":"c8932aad-4b86-469d-bd8f-2bf715c94448","lname":"Brown"} 
    2021-06-05 19:41:20.2842 INFO (XyzConnectorLog ) : Set-XyzAccount id=c8932aad-4b86-469d-bd8f-2bf715c94448 fname= lname= title=President 
    2021-06-05 19:41:20.2842 DEBUG (XyzConnectorLog ) :   * parameters = {"id":"c8932aad-4b86-469d-bd8f-2bf715c94448","title":"President"} 
    2021-06-05 19:41:20.3152 INFO (XyzConnectorLog ) : Set-XyzAccount2 id=c8932aad-4b86-469d-bd8f-2bf715c94448 fname= lname= title= 
    2021-06-05 19:41:20.3152 DEBUG (XyzConnectorLog ) :   * parameters = {"id":"c8932aad-4b86-469d-bd8f-2bf715c94448"} 
    2021-06-05 19:41:20.3152 INFO (XyzConnectorLog ) : Get-XyzAccount id=c8932aad-4b86-469d-bd8f-2bf715c94448 
    2021-06-05 19:41:20.3152 DEBUG (XyzConnectorLog ) :   > {"fname":"Bob","title":"President","disabled":"0","id":"c8932aad-4b86-469d-bd8f-2bf715c94448","lname":"Brown"} 
    2021-06-05 19:41:20.3642 INFO (XyzConnectorLog ) : Get-XyzAccount id=c8932aad-4b86-469d-bd8f-2bf715c94448 
    2021-06-05 19:41:20.3642 DEBUG (XyzConnectorLog ) :   > {"fname":"Bob","title":"President","disabled":"0","id":"c8932aad-4b86-469d-bd8f-2bf715c94448","lname":"Brown"} 
    2021-06-05 19:41:20.4512 INFO (XyzConnectorLog ) : Disconnect-Xyz 
    

    Log: Update on Bob changed title from President back to Vice-President (now with the ForceSyncOff parameter disabled)

    2021-06-05 20:01:50.7028 INFO (XyzProvisionLog ) : >> Process CCC_Xyz_Account_Provision: Event: UPDATE 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) : Connection variables: 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   GenProcID: f35b201f-d84b-4a57-823a-33ee96fc2737 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   QBMProduct: Manager 
    2021-06-05 20:01:50.7028 DEBUG (XyzProvisionLog ) : Entity: Xyz/Bob Brown (Xyz) 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   AccountDisabled: False 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   AccountExpires: 12/30/1899 12:00:00 AM 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   AccountName: Bob 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   CanonicalName: Xyz/Bob Brown 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   cn: Bob Brown 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   Description: President -> Vice-president 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   DisplayName: Xyz/Bob Brown (Xyz) 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   DistinguishedName: user=Bob Brown,system=Xyz 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   FirstName: Bob 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   IdentityType:  
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   IsGroupAccount: False 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   IsPrivilegedAccount: False 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   LastLogon: 12/30/1899 12:00:00 AM 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   LastName: Brown 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   MatchPatternForMembership: 0 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   MemberOf:  
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   ObjectGUID: c8932aad-4b86-469d-bd8f-2bf715c94448 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   Password: *** 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   PWDLastSet: 12/30/1899 12:00:00 AM 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   RiskIndexCalculated: 0.05 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   UID_Person:  
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   UID_TSBAccountDef:  
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   UID_TSBBehavior:  
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   UID_UNSAccountB: cc891d09-7433-4378-9873-a521329952e5 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   UID_UNSContainerB:  
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   UID_UNSRootB: 35dc1a72-ed10-421e-bca6-fa730d6fc43a 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   XDateInserted: 6/5/2021 6:45:14 AM 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   XDateUpdated: 6/5/2021 5:40:56 PM 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   XMarkedForDeletion: 0 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   XObjectKey: <Key><T>UNSAccountB</T><P>cc891d09-7433-4378-9873-a521329952e5</P></Key> 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   XTouched:  
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   XUserInserted: Synchronization 
    2021-06-05 20:01:50.7028 TRACE (XyzProvisionLog ) :   XUserUpdated: viadmin 
    2021-06-05 20:01:50.7495 TRACE (XyzProvisionLog ) : ObjectKey: <Key><T>UNSAccountB</T><P>cc891d09-7433-4378-9873-a521329952e5</P></Key> 
    2021-06-05 20:01:50.7495 TRACE (XyzProvisionLog ) : AdHocData: 
    2021-06-05 20:01:50.7495 TRACE (XyzProvisionLog ) :   ConnectionUID: CCC-6FF2F8A2B54AEE4EA03CF45BA9C9B198 
    2021-06-05 20:01:50.7495 TRACE (XyzProvisionLog ) :   VariableSetUID: CCC-A10985E7CE665640A5593A20AEA412C7 
    2021-06-05 20:01:50.7495 TRACE (XyzProvisionLog ) :   ExecutionServerUID: B3A90D04-819D-4082-9B30-5F880C1CDE29 
    2021-06-05 20:01:50.7495 TRACE (XyzProvisionLog ) :   ExecutionServerTag:  
    2021-06-05 20:01:50.7495 TRACE (XyzProvisionLog ) :   ProjectionConfigUID: CCC-0962E299E0F2234AAC91F1D5FADEBEC4 
    2021-06-05 20:01:50.9331 INFO (XyzProvisionLog ) : NeedExecute: True 
    2021-06-05 20:02:51.3780 INFO (XyzConnectorLog ) : Connect-Xyz file=C:/1im-xyz-main/Xyz.json 
    2021-06-05 20:02:51.6970 INFO (XyzConnectorLog ) : Get-XyzAccount id=c8932aad-4b86-469d-bd8f-2bf715c94448 
    2021-06-05 20:02:51.7120 DEBUG (XyzConnectorLog ) :   > {"fname":"Bob","title":"President","disabled":"0","id":"c8932aad-4b86-469d-bd8f-2bf715c94448","lname":"Brown"} 
    2021-06-05 20:02:51.9210 INFO (XyzConnectorLog ) : Set-XyzAccount id=c8932aad-4b86-469d-bd8f-2bf715c94448 fname= lname= title=Vice-president 
    2021-06-05 20:02:51.9210 DEBUG (XyzConnectorLog ) :   * parameters = {"id":"c8932aad-4b86-469d-bd8f-2bf715c94448","title":"Vice-president"} 
    2021-06-05 20:02:51.9570 INFO (XyzConnectorLog ) : Set-XyzAccount2 id=c8932aad-4b86-469d-bd8f-2bf715c94448 fname= lname= title= 
    2021-06-05 20:02:51.9570 DEBUG (XyzConnectorLog ) :   * parameters = {"id":"c8932aad-4b86-469d-bd8f-2bf715c94448"} 
    2021-06-05 20:02:51.9570 INFO (XyzConnectorLog ) : Get-XyzAccount id=c8932aad-4b86-469d-bd8f-2bf715c94448 
    2021-06-05 20:02:51.9570 DEBUG (XyzConnectorLog ) :   > {"fname":"Bob","title":"Vice-president","disabled":"0","id":"c8932aad-4b86-469d-bd8f-2bf715c94448","lname":"Brown"} 
    2021-06-05 20:02:52.0040 INFO (XyzConnectorLog ) : Get-XyzAccount id=c8932aad-4b86-469d-bd8f-2bf715c94448 
    2021-06-05 20:02:52.0040 DEBUG (XyzConnectorLog ) :   > {"fname":"Bob","title":"Vice-president","disabled":"0","id":"c8932aad-4b86-469d-bd8f-2bf715c94448","lname":"Brown"} 
    2021-06-05 20:02:52.0777 INFO (XyzConnectorLog ) : Disconnect-Xyz 
    

  • Niels,
    thanks for testing my example,
    and if we return to the question of passing attributes, we can see that the arguments of "lname" and "fname" of Set-XyzAccount were not passed (lines 50-51 of log 2 and 3). Here, this is not a problem, but in a real case (the system is a DBMS but I cannot use the native DB-connector) to update the account data I must call a stored procedure into which I must pass on values of all account attributes. Does the PS-connector pass only the changed attributes to the command under ANY CONDITIONS and must I read the objects from the system EVERY TIME before changing it? And why the "title" parameter did not passed when calling Set-XyzAccount2 after Set-XyzAccount (lines 52-53)?

  • I've think we run into a bug, issue in a nutshell:

    Powershell connector: Mandatory properties are not passed to powershell cmdlet/function when updating.

    Config for mandatory property:
    - Custom process contains parameter ForceSyncOf (Value = "LastName,FirstName,Description")
    - Powershell Conn, Definition - Class User:  <Property Name="LastName" DataType="String" IsMandatory="true">

    Issue the mandatory properties are 
    treated the same as non-mandatory properties. Thus when the sync-engine receives an update:
    it first runs a "Get-User", compares the returned properties to the EntityPatch from the AdHocProjection proces.
    and than sets the parameters on the powershell cmdlet/function only for changed properties.

    I've found a 'dirty' work-around when  you use IsMandatory="true" in combination with IsUniqueKey="true" the property is treated as Mandatory. Beats me?

    I've think it's time to call support.

  • I've made a service request and will keep you updated.

  • Thank you Niels! I will wait for the good news )

  • Here is the update...

    Service request:
    Posh connector: Mandatory properties are not passed to powershell cmdlet/function when updating

    Description
    Issue in Powershell connector: mandatory properties are treated the same as non-mandatory properties when updating.

    Example config for mandatory property:
    - Custom process contains parameter:
    ForceSyncOf (Value = LastName,FirstName,Description")
    - Powershell Conn: Definition file: Class User:
    <Property Name="LastName" DataType="String" IsMandatory="true">

    I've found a work-around when you use IsMandatory="true" in combination with IsUniqueKey="true" the property is treated as Mandatory

    Final response from support:
    After some more analysis product defect #34520 has been requalified as a feature and tracked by Enhancement Request ER #34520 now.

    It appears that the use of "ForceSyncOf" does not guarantee the transfer of those fields into the target system - it only guarantees that those properties will be mapped during provisioning (this JobParamter should have been called "ForceMappingOf" which better maps its purpose).

    The sync engine transfers always ONLY the changed properties. All other connectors will also have to load the object the second time to get some properties that are necessary for the operation. Hence, we will think about the new feature to somehow mark the properties as mandatory for a command. But if decided to implement, it will be implemented only in the future release of the product. Until then, an object will have to be loaded again (in a wrapper command that loads mandatory properties from the target system and uses them in the actual cmdlet-call).