exentions arributes

Welcome Forums General PowerShell Q&A exentions arributes

This topic contains 4 replies, has 3 voices, and was last updated by

 
Participant
1 year ago.

  • Author
    Posts
  • #89368

    Participant
    Points: 0
    Rank: Member

    Need to edit the extension attributes for users. Example:
    call csv that has column of: samaccountname
    change: extensionAttribute1 to an ip: 1.1.1.1

    The extension attributes are located within adsiedit for users and there are 15 extension attributes.

    Your insight and help are greatly appreciated.

  • #89369

    Keymaster
    Points: 1,704
    Helping HandTeam Member
    Rank: Community Hero

    Use Set-ADUser and pass a hash table to its -Property (or is it -Properties?) parameter, as shown in the help file examples.

    • #89375

      Participant
      Points: 0
      Rank: Member

      Hey Don,

      import-csv C:\users1.csv | % {set-aduser -identity $_.samaccountname -extensionattribute1 $_.extensionattribute1}
      Set-ADUser : A parameter cannot be found that matches parameter name 'extensionattribute1'.
      At line:1 char:70
      + ... {set-aduser -identity $_.samaccountname -extensionattribute1 $_.exte ...
      + ~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : InvalidArgument: (:) [Set-ADUser], ParameterBindingException
      + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.ActiveDirectory.Management.Commands.SetADUser

  • #89372
    Jon

    Participant
    Points: 38
    Rank: Member

    I know you are new to powershell based on your other post, but the best way to learn is to try!

    Try writing some stuff and let us know where you run into problems.

    Read these:

    https://technet.microsoft.com/en-us/library/ee617241.aspx

    https://blogs.technet.microsoft.com/heyscriptingguy/2013/12/22/powertip-set-custom-attributes-in-active-directory/

  • #89386

    Participant
    Points: 0
    Rank: Member

    got it with this.

    import-csv C:\users1.csv | % {set-aduser -identity $_.samaccountname -Add @{extensionAttribute4="myString"}}

    thanks all!

The topic ‘exentions arributes’ is closed to new replies.