neonetman Posted July 5, 2022 Posted July 5, 2022 Good morning, I've an entire year group of pupils where the first name and surname fields have been input the wrong way round. Is there a way I can easily bulk swap these over either within ADUC or using PowerShell? Cheers
CHiLL Posted July 5, 2022 Posted July 5, 2022 I believe ADModify still works: https://techcommunity.microsoft.com/t5/exchange-team-blog/admodify-net-is-here/ba-p/610119
neonetman Posted July 5, 2022 Author Posted July 5, 2022 Sadly the download link doesn't work any longer
tdk1069 Posted July 5, 2022 Posted July 5, 2022 foreach ($user in (get-aduser -Filter * -searchBase "")) {Set-ADUser $user -GivenName $user.Surname -Surname $user.GivenName } Quick n Dirty (Shhh you lot) . if you aren't logged in as someone with permissions you'll need -Credential (var with creds in) feel free to add -WhatIF to the set-aduser to preview first *cough check!*
CHiLL Posted July 5, 2022 Posted July 5, 2022 Sorry, I should have checked the link. It looks like Powershell is the answer (but I can't think of the commands off the top of my head). Are there more fields, other than the givenName and sn that need changing? Unless specified otherwise, I believe fields like the displayname, sAMAccountName, userPrincipalName, mail, etc, are built automatically.
jthompson Posted July 5, 2022 Posted July 5, 2022 Bulk AD Users is another powerful option. It'll allow you do a CSV-based update. A CSV with columns for sAMAccountName, givenName and sn should do the trick.
neonetman Posted July 5, 2022 Author Posted July 5, 2022 Thanks everyone, the archive link to ADModify sorted it and I've managed to get it sorted. Thank you all for your help and suggestions
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now