Reputation:
How can I delete a user in an OU in Active Directory with PowerShell script. I tried writing this code under, but it gives me an error
A parameter cannot be found that matches parameter name "Name".
My code:
Remove-ADUser -Name Test -Surname User -GivenName Test -SamaccountName testuser
Upvotes: 0
Views: 274
Reputation: 13227
The error message is as it says, there isn't a parameter called Name. For Remove-ADUser you need to use Identity:
Remove-ADUser -Identity ADUser
Upvotes: 3