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

  • 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
    ]]>

  • 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 )

Reply Children
No Data