Sure, here's an example:
' BEGIN SCRIPT -------------------------------------
Dim Container
Dim ContainerName
Dim User, UsrSID, b
Dim WshNetwork
Set WshNetwork = WScript.CreateObject("WScript.Network")
ComputerName=WshNetwork.ComputerName
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & ComputerName & "\root\cimv2")
strSelect="Select * from Win32_UserAccount"
Set colSystemUsers = objWMIService.ExecQuery (strSelect)
For Each objSystemUser in colSystemUsers
if Right(objSystemUser.SID,3)="500" Then
Set objUser = GetObject("WinNT://" & ComputerName & "/" &
objSystemUser.Name & ",user")
NewPassword="MySuperPasswordNoBodyWouldGuess"
Call objUser.SetPassword(NewPassword)
Exit For
End If
Next
' END SCRIPT ---------------------------------------
The script works with any renamed built-in administrator account as it uses
RID lookup instead of name lookup (built-in administrator account always has
RID=500).
--
Dmitry Korolyov [
[email protected]]
MVP: Windows Server - Active Directory
Dimitry,
can you help me for writing script.
thanks...