populate aduser with manager name

Welcome Forums General PowerShell Q&A populate aduser with manager name

Viewing 2 reply threads
  • Author
    Posts
    • #233404
      Participant
      Topics: 41
      Replies: 94
      Points: 560
      Rank: Major Contributor

      Hi,
      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 message

      the code I use

      Paul

    • #233419
      Participant
      Topics: 7
      Replies: 2458
      Points: 6,439
      Helping Hand
      Rank: Community MVP

      Paul,

      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.

    • #233539
      Participant
      Topics: 41
      Replies: 94
      Points: 560
      Rank: Major Contributor

      thanks Olaf

      wasn’t aware that the samaccount was also possible

       

      Paul

Viewing 2 reply threads
  • The topic ‘populate aduser with manager name’ is closed to new replies.