adamtrask
asked on
Using PowerShell to check if an ADUser is disabled to enable or enabled to disabled
Good morning experts,
This morning I received two lists for checking - both of Adjunct instructors in our college.
One list has the current instructors, who should be enabled in active directory and the second contains Adjuncts who left us and need to be disabled.
I need to learn to use an if statement to check if a certain person is enabled to disable him/her: Something like the following in correct PowerShell syntax:
if (InstructorName enabled == true)
{
InstructorName enabled = false;
}
Thank you for your help
Adam
This morning I received two lists for checking - both of Adjunct instructors in our college.
One list has the current instructors, who should be enabled in active directory and the second contains Adjuncts who left us and need to be disabled.
I need to learn to use an if statement to check if a certain person is enabled to disable him/her: Something like the following in correct PowerShell syntax:
if (InstructorName enabled == true)
{
InstructorName enabled = false;
}
Thank you for your help
Adam
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sadly no. But you only need to know a few basics about PowerShell, and a few about ActiveDirectory, to be able to run simple tasks. Most of it is trying out anyway, and PS is a great tool for doing that.
ASKER
Thank you Qlemo,,,
ASKER