« Back to the main page

Language: Plain Text, Submitted: 6/17/10, Country: United States - Raw | Download
Set oWshNet = CreateObject("WScript.Network" ) 
sNode = oWshNet.ComputerName 

Set oGroup = GetObject("WinNT://" & sNode & "/Administrators" ) 

' If not myadminuser and not local administrator, remove it
For Each oUser In oGroup.Members 
	sU = LCase(oUser.Name) 
	If sU <> "myadminuser" AND sU <> "administrator" then
		oGroup.Remove oUser.ADsPath 
	End if
Next 

' Set local administrator password
Set objUser = GetObject("WinNT://" & sNode & "/Administrator,user")
objUser.SetPassword ""
objUser.SetInfo