Cum adaugi un user in grupul de Administratori pe un server

Configurare noua (How To)

Situatie

Vrei sa adaugi mai usor un utilizator in grupul de Administratori.

Solutie

Deschizi Powershell ca administrator si rulezi urmatorul script :

#Variables
$Domain = Read-Host “Domain name:”
$Server = Read-Host “Server name:”
$User = Read-Host “User name:”
#Add user to local admin group (Uses the ADSI adapter)
$AdminGroup = [ADSI]”WinNT://$Server/Administrators,group”
$User = [ADSI]”WinNT://$Domain/$User,user”
$AdminGroup.Add($User.Path)

Tip solutie

Permanent

Voteaza

(2 din 5 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?