Bulk update active directory users department. RRS feed

  • General discussion

  • Hi,

    I am currently running the below script to bulk update department with same script i was able to update the field few months before.

    But this time failing. Possible it is execution error any help is appreciated.

    Screen shot is attached.

    Import-module ActiveDirectory
    Import-CSV .\ADupdateinfo.csv | ForEach-Object {$User = $_.UserName Set-ADUser -Identity $User -Displayname $_Displayname -title $_.title -department $_.department -Manager $_.Manager -Mobile $_.Mobile}

    Import-CSV .\test1.csv | ForEach-Object {$User = $_.UserName | Set-ADUser -Identity $User -Displayname $_.Displayname -title $_.title -department $_.department -Manager $_.Manager -Mobile $_.Mobile}

    Monday, August 26, 2019 11:21 AM