将用户添加到本地管理员组的脚本

Option Explicit
Dim WshNetwork
Dim LocalGroup
Dim LocalComputer
Set WshNetwork = WScript.CreateObject("WScript.Network")
LocalComputer = WshNetwork.ComputerName
Set LocalGroup = GetObject("WinNT://" + LocalComputer + "/Administrators,Group")
If LocalGroup.IsMember("WinNT://domain name/domain admins") Then
WScript.Quit
Else
LocalGroup.Add "WinNT://domain name/domain admins"
End If
 

你可能感兴趣的:(用户,职场,脚本,休闲,本地管理员组)