LindyS
asked on
PowerShell Script to disable a list of users
I need a powershell script to read a list of users from a txt file, disable the user account and change the description of each user.
Any good ideas?
Any good ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This would work, if I were able to modify users with a script.
OK, I missed something, let's try with
Get-Content <path-to-txt-file-with-use rs> | %{ Get-QADUser $_ | Disable-QADUser }
I'm sorry.
Krzysztof
Get-Content <path-to-txt-file-with-use
I'm sorry.
Krzysztof
OK, I missed something, let's try with
Get-Content <path-to-txt-file-with-use rs> | %{ Get-QADUser $_ | Disable-QADUser }
I'm sorry.
Krzysztof
Get-Content <path-to-txt-file-with-use
I'm sorry.
Krzysztof
ASKER
Disable-QADUser : Access is denied.
At C:\scripts\Disable.ps1:18 char:56
+ Get-Content "C:\temp\userlist.txt" | %{ Disable-QADUser <<<< $_ }
+ CategoryInfo : NotSpecified: (:) [Disable-QADUser], UnauthorizedAccessExceptio
+ FullyQualifiedErrorId : System.UnauthorizedAccessE