nav2567
asked on
bulk check and disable user accounts in AD.
Hello,
We have a list of user first and last names in separate columns in a CSV file.
Would someone advise a PS command to read this CSV file and return another file that contain their first and last names, account status (account disable or enable) and UPN names?
We also need a PS command to disable these UPN names if they are currently enabled.
Thanks.
We have a list of user first and last names in separate columns in a CSV file.
Would someone advise a PS command to read this CSV file and return another file that contain their first and last names, account status (account disable or enable) and UPN names?
We also need a PS command to disable these UPN names if they are currently enabled.
Thanks.
OK so to get this right 1) you have a list of users 2) they or may not be disabled 3) if they are disabled do nothing 4) if enabled then disable if that what you want?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Script will do as requested, but good idea to look at gui ad tools as well if your not comfortable using scripts.
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/import-csv?view=powershell-5.1
http://ps1scripting.blogspot.com/2012/07/powershell-working-with-csv-files.html
Open in new window
You have to see a step at a time on whether the data ....
https://technet.microsoft.com/en-us/library/ee617197.aspx
you want to scan the AD and then based on the CSV deactivate if needed, or reactivate if disabled...
Look at MS powershell 5.1 link it includes references that may have scripts that do what you are looking for potentially need to be slightly adapted to the specific scenario that you have.