exentions arributes

This topic contains 4 replies, has 3 voices, and was last updated by  chrodriguez1 1 month, 1 week ago.

  • Author
    Posts
  • #89368

    chrodriguez1
    Participant

    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

    Don Jones
    Keymaster

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

    • #89375

      chrodriguez1
      Participant

      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

    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

    chrodriguez1
    Participant

    got it with this.

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

    thanks all!

You must be logged in to reply to this topic.