Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Bulk Edit AD Object Name

$
0
0

Hi All,

I am trying to bulk edit users in AD. I need to amend the Name attribute in AD with a comment for a list of users. 

I have the list of samaccountnames and came up with the following in Poowershell:

$users = (get-content C:\temp\sama3.txt)
foreach ($user in $users) {
rename-adobject -identity (get-aduser $user).distinguishedname -newname "Bla, bla"
}

I am having problems making the last part take the current Name and add my comment to it.

Would you be able to help me make that modification without overcomplicating it?

Thanks in advance,

Szadzik



Viewing all articles
Browse latest Browse all 15028

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>