Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Append user description field in AD for list of users

$
0
0

Need to append to the existing description of AD user accounts.

Tried successfully for a single user testuser with this command:

get-aduser testuser -Properties Description | ForEach-Object { Set-ADUser $_ -Description "$($_.Description) additional text" }

Need to do same for a user names in a txt file. Tried commands below, but it works when it is only one account name in the 1.txt file.

$user = Get-Content "1.txt"

get-aduser $user -Properties Description | ForEach-Object { Set-ADUser $_ -Description "$($_.Description) additional text." }

 

Please help


Viewing all articles
Browse latest Browse all 6937

Trending Articles