I have a two part get-aduser / set-aduser question. RRS feed

  • Question

  • I'm trying to figure out how to do this.   I need to run

    get-aduser -filter {ExtensionAttribute14 -like "YES"}

    then take that list and clear that attribute on users who have it.

    then I need to read in a username list from a text file and set that attribute on those users.    I'm running into issues with pipeing commands.

    Wednesday, January 30, 2013 5:21 PM


  • 1) Clear

    Get-ADUser -Filter {$_.ExtensionAttribute14 -like "YES"} | Set-ADUser -Clear ExtensionAttribute14
    2) Set
    Get-Content users.txt | Get-ADUser  |  Set-ADUser -ADD @{ExtensionAttribute14="YES"}

    Wednesday, January 30, 2013 5:25 PM