Powershell connector - empty variables during updating

Hello folks!

During trying to update user object, for some reason OneIM seems is not passing parameters to the Powershell function. How it looks:

XML schema for user:

<ReadConfiguration>
				<ListingCommand Command="Get-UserList">
					<SetParameter Param="Address" Source="ConnectionParameter" Value="Address"/>
					<SetParameter Param="UsernameNPA" Source="ConnectionParameter" Value="UsernameNPA"/>
					<SetParameter Param="Password" Source="ConnectionParameter" Value="Password"/>
				</ListingCommand>
				<CommandSequence>
					<Item Command="Get-UserList" Order="1">
						<SetParameter Param="Address" Source="ConnectionParameter" Value="Address"/>
						<SetParameter Param="UsernameNPA" Source="ConnectionParameter" Value="UsernameNPA"/>
						<SetParameter Param="Password" Source="ConnectionParameter" Value="Password"/>
					</Item>
				</CommandSequence>
			</ReadConfiguration>
			<MethodConfiguration>
				<!--Define a method named "Insert"-->
				<Method Name="Insert">
					<!--An "Insert" consists of the following command calls-->
					<CommandSequence>
						<Item Command="Create-PAUser" Order="1">
							<SetParameter Param="Address" Source="ConnectionParameter" Value="Address"/>
							<SetParameter Param="UsernameNPA" Source="ConnectionParameter" Value="UsernameNPA"/>
							<SetParameter Param="Password" Source="ConnectionParameter" Value="Password"/>
						</Item>
					</CommandSequence>
				</Method>

				<Method Name="Update">
					<CommandSequence>
						<Item Order="1" Command="Update-PAUser" Condition="ModificationExists">
							<SetParameter Param="Address" Source="ConnectionParameter" Value="Address"/>
							<SetParameter Param="UsernameNPA" Source="ConnectionParameter" Value="UsernameNPA"/>
							<SetParameter Param="Password" Source="ConnectionParameter" Value="Password"/>
						</Item>
					</CommandSequence>
				</Method>

			</MethodConfiguration>

XML object properties:

				<Property Name="ID" IsMandatory="true" IsUniqueKey="true" DataType="String" IsDisplay="true" IsAutoFill="true">
					<CommandMappings>
						<Map Parameter="ID" ToCommand="Get-UserList"/>
						<Map Parameter="ID" ToCommand="Update-UserInfo"/>
					</CommandMappings>

					<ReturnBindings>
						<Bind Path="ID" CommandResultOf="Get-UserList"/>
						<Bind Path="ID" CommandResultOf="Update-UserInfo"/>
					</ReturnBindings>
				</Property>

	<Property Name="FirstName" IsMandatory="false" IsUniqueKey="false" DataType="String" IsDisplay="true">
					<CommandMappings>
						<Map Parameter="FirstName" ToCommand="Get-UserList"/>
						<Map Parameter="FirstName" ToCommand="Update-UserInfo"/>
					</CommandMappings>
					<ModifiedBy>
						<ModBy Command="Update-UserInfo"/>
					</ModifiedBy>
					<ReturnBindings>
						<Bind Path="FirstName" CommandResultOf="Get-UserList"/>
						<Bind Path="FirstName" CommandResultOf="Update-UserInfo"/>
					</ReturnBindings>
				</Property>



				<Property Name="LastName" IsMandatory="false" IsUniqueKey="false" DataType="String" IsDisplay="true">
					<CommandMappings>
						<Map Parameter="LastName" ToCommand="Get-UserList"/>
						<Map Parameter="LastName" ToCommand="Update-UserInfo"/>
					</CommandMappings>
					<ModifiedBy>
						<ModBy Command="Update-UserInfo"/>
					</ModifiedBy>
					<ReturnBindings>
						<Bind Path="LastName" CommandResultOf="Update-UserInfo"/>
						<Bind Path="LastName" CommandResultOf="Get-UserList"/>

					</ReturnBindings>
				</Property>

During browsing target system, object is returned correctly however try to modify object generates a call to function for UPDATE in powershell however when I tried to log passed parameters, the userName NPA, password are empty, null.

Error in short: "[1777007] Error committing 1 system objects. - Cannot bind argument to parameter 'username' because it is an empty string."

Version of One Identity - 8.2.1.

Variable set is filled, contain value.

Maybe any suggestions into what I can look? 

Parents Reply
  • Hi Niels

    I seem to have the same issue as PJ, but I don't quite understand the resolution in the link. Can you spell it out for me? cmdlets?? 

    "Use cmdlets, which require mandatory parameters, do "Reload" before "Update", so custom cmdlets must load necessary properties for given objects from the target system and then use the values of those properties when making calls with required parameters."

Children
  • Hello Kristian,

    I made a service request about this 3 years ago the KB article 437453 is the result statement from Quest.
    See the following post for the full story: Powershell connector and ForceSyncOf parameter.

    Short version: Service request and response 
    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).


    HtH
    Niels