- This topic has 2 replies, 2 voices, and was last updated 3 months, 2 weeks ago by
June 4, 2020 at 8:34 pm #233404ParticipantTopics: 41Replies: 94Points: 560Rank: Major Contributor
in our offboarding script we clear the managers name in the organization tab and store this in the extentionAttribute11
so far so good.
in case of reactivating this user we need to retrieve the managers name from extentionAttribute11 and insert it back into the managers field under the organization tab and this gives the following error messagePowerShell1Identity info provided in the extended attribute: ‘Manager’ could not be resolved. Reason: ‘Cannot find an object with identity: ‘John Doe’
the code I usePowerShell123456$user=”myUser”#$man=(get-aduser $user.manager).DistinguishedName$manager = Get-ADUser $user -Properties extensionAttribute11$manager= $manager.extensionAttribute11Set-ADUser $user -Manager $manager
June 4, 2020 at 9:17 pm #233419ParticipantTopics: 7Replies: 2458Points: 6,439Rank: Community MVP
when you (re-)read the help for Set-ADUser and its parameter -Manager you will see that it expects one of four possible inputs:
– A distinguished name
– A GUID (objectGUID)
– A security identifier (objectSid)
– A SAM account name (sAMAccountName)
I assume you are providing a string representative of the display name or the object name. I’d recommend to save the sAMAccountName in the extentionAttribute when you do your offboarding process.
June 5, 2020 at 5:36 am #233539ParticipantTopics: 41Replies: 94Points: 560Rank: Major Contributor
wasn’t aware that the samaccount was also possible
- The topic ‘populate aduser with manager name’ is closed to new replies.