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
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.