rem Author Kolesnikov Vlad rem ACL changepass vbs rem allow domain adm

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
rem Author: Kolesnikov Vlad
rem ACL changepass.vbs
rem allow domain admins full access
rem allow domain computers read&execute
rem deny domain controllers full access
rem deny OtherServers full access
rem ACL logfilepath
rem allow domain admins full access
rem allow domain computers create files&write data this folder only
rem allow creator owner full access
logfilepath="\\server\wdata\chps\"
newpass="*********"
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & WshNetwork.ComputerName & "\root\cimv2")
logfilename=logfilepath & WshNetwork.ComputerName & ".txt"
rem msgbox (logfilename)
Set colSystemUsers = objWMIService.ExecQuery("Select * from Win32_UserAccount where Domain=""" & WshNetwork.ComputerName & """")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(logfilename,2,True)
objFile.WriteLine "Started " & Date & " " & Time
For Each objSystemUser in colSystemUsers
if objSystemUser.Name<>"HelpAssistant" and objSystemUser.Name<>"SUPPORT_388945a0" and objSystemUser.Name<>"krbtgt" and objSystemUser.Name<>"ASPNET" then
objFile.WriteLine "Working " & objSystemUser.Name
Set objUser = GetObject("WinNT://" & WshNetwork.ComputerName & "/" & objSystemUser.Name & ",user")
Call objUser.SetPassword(newpass)
objFile.WriteLine "OK"
end if
Next
objFile.WriteLine "Finished " & Date & " " & Time
objFile.Close