简体   繁体   中英

Delete a user in powershell Active Directory not working

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM