Enlever à distance un adminstrateur local.

Posted by on Jan 2, 2011 in Windows

Enlever à distance d’un compte du domaine du groupe « Administrators » d’un ordinateur ou serveur.

 $computer  = Read-Host "Enter computer name"
 $user = Read-Host "Enter user name"
 $domain = ([ADSI]"").name
 ([ADSI]"WinNT://$computer/Administrators,group").Remove("WinNT://$domain/$user")

Post a Reply

Your email address will not be published. Required fields are marked *