Posted in
Hosting & IIS7,
Windows Powershell,
Windows Server |
No Comment | 4,669 views | 02/03/2010 12:26
It’s very easy to remove an Active Directory user with Powershell.
1
2
| $CustomerOU = [ADSI] "LDAP://$CustomerOU,$FQDN"
$RemoveADUser = $CustomerOU.Delete("User", "CN=$Username") |
$CustomerOU = [ADSI] "LDAP://$CustomerOU,$FQDN"
$RemoveADUser = $CustomerOU.Delete("User", "CN=$Username")
Again and again, please be sure about your LDAP path.
Posted in
Windows Powershell,
Windows Server |
4 Comments | 4,351 views | 22/08/2009 10:28
Are you kidding? How can I use “Remove-ADUser” to delete an user from Active Directory if there is no “-force” switch? Simply, it is for blocking automation scripts. We have so many IIS users in Active Directory. What should we do? Should we hire a new guy to manage users? I quit to use Powershell v2 AD modules for a while.
Update: You can assign $false to confirm parameter:
Remove-ADUser "User1" -Confirm:$False |
Remove-ADUser "User1" -Confirm:$False
Thanks to Shay Levi.