roblobster Posted August 5, 2013 Posted August 5, 2013 (edited) I am trying to remove a bunch of users that I have extracted from AD and exported to a csv is formated this way: SamAccountName user1 user2 user3 I am trying to run the following in a ps script: Import-Csv .\delete1.csv | foreach-object { remove-aduser -identity $_.SamAccountName -confirm:$false } i then get the following error: Remove-ADUser : Cannot validate argument on parameter 'Identity'. The argument is null. Supply a non-null argument and try the command again. At C:\remove\deleteuser.ps1:2 char:24 + remove-aduser -identity <<<< $_.SamAccountName -confirm:$false } + CategoryInfo : InvalidData: ( [Remove-ADUser], ParameterBindi ngValidationException + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Activ eDirectory.Management.Commands.RemoveADUser Any ideas on what I am missing? Edited August 5, 2013 by roblobster
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