Is it possible to update the nativeIdentity in the BeforeCreate rule for AD?
I am trying to generate a new login name for the user which will be the CN & sAMAccountName. I am able to add the new sAMAccountName to the $requestObject, but i’m unable to update the nativeIdentity. Here is my script:
||$span = AZZ |
|---|---|
||$newName = Generate-NextName -span $span --> This generates the next value - BAA |
||LogToFile(PS Script>>>>>> New name: $newName) |
||#Add sAMAccountNAme to the requestObject |
||$attrsAMAccountName = New-Object SailPoint.Utils.objects.AttributeRequest; |
||$attrsAMAccountName.Name = sAMAccountName; |
||$attrsAMAccountName.value= QI+$newName; |
||$attrsAMAccountName.Operation = Add; |
||$requestObject.AttributeRequests.Add($attrsAMAccountName); |
||$dn = CN=+QI+$newName+,OU=Users,OU=XXXXX,OU=LXS Objects Test,DC=ad,DC=XXXX,DC=com; |
||$requestObject.nativeIdentity.Set($dn); --> this method nativeIdentity.Set does not exist |
||$ModifiedRequestObjectXml=$requestObject.toXml();|
$requestObject.nativeIdentity.Set($dn); – this is wrong. Is there any documentation where i can find the availbale metods? I just tried to guess and used $requestObject.nativeIdentity.Set($dn) but this metod does not exist.
Any ideas?
I think you are trying to move the user from one OU to another. For this you can find the example at this post. There is sample rule you may use it and leverage some of the logic which you want