21
Feb/100
Feb/100
WinDirStat: Visual Directory Statistics (Freeware)
WinDirStat is a very nice disk usage statistics viewer and cleanup tool for Microsoft Windows. You can get it for free at this location: http://windirstat.info
351 views
18
Feb/100
Feb/100
Add Domain Users / Groups to local Groups remotely
Script that adds a Domain User to a local Group remotely.
Change the “DomainName” variable to suit your requirements.
Requires 3 Arguments:
[Machine Name] [Local Group to modify] [Domain User/Group to add]
?Download AddToLocalGroup.vbs
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 38 | If (WScript.Arguments.Count < 3) Then WScript.Echo "3 Arguments required: [Machine Name] [Local Group to modify] [Domain User/Group to add]" WScript.Quit 1 End If Dim DomainName Set net = WScript.CreateObject("WScript.Network") DomainName = "yourdomain.com" WScript.Echo "" WScript.Echo WScript.Arguments(0) WScript.Echo "===================" set group = GetObject("WinNT://"& WScript.Arguments(0) &"/"& WScript.Arguments(1) &"") on error resume next WScript.Echo "Before:" For Each objUser In group.Members WScript.Echo objUser.Name next group.Add "WinNT://"& DomainName &"/"& WScript.Arguments(2) &"" CheckError sub CheckError if not err.number=0 then set ole = CreateObject("ole.err") WScript.Echo ole.oleError(err.Number) err.clear else WScript.Echo "" WScript.Echo "After:" For Each objUser In group.Members WScript.Echo objUser.Name next end if end sub |
508 views
18
Feb/100
Feb/100
Get Service Pack Levels of Servers via Active Directory
Script that queries Active Directory to retrieve Service Pack Levels (In this example only from Windows Server 2003 Machines)
Modify the strContainer variable to your requirements.
?Download GetServicePacks.vbs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | On Error Resume Next Const ADS_SCOPE_SUBTREE = 2 strContainer = "DC=yourdomain,DC=com" Set objConnection = CreateObject("ADODB.Connection") Set objCommand = CreateObject("ADODB.Command") objConnection.Provider = ("ADsDSOObject") objConnection.Open "Active Directory Provider" objCommand.ActiveConnection = objConnection objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE objCommand.Properties("Page Size") = 1000 objCommand.CommandText = _ "SELECT CN, operatingSystem, operatingSystemVersion, operatingSystemServicePack FROM 'LDAP://" & strContainer & "' " _ & "WHERE objectCategory='computer' AND operatingSystem = 'Windows Server 2003' " Set objRecordSet = objCommand.Execute objRecordSet.Sort = "CN" objRecordSet.MoveFirst Do Until objRecordSet.EOF Wscript.Echo objRecordSet.Fields("CN").Value & "," & objRecordSet.Fields("operatingSystem").Value & "," & objRecordSet.Fields("operatingSystemVersion").Value & "," & objRecordSet.Fields("operatingSystemServicePack").Value objRecordSet.MoveNext Loop |
240 views
18
Feb/100
Feb/100
Set the local User Password remotely via script
3 simple Lines that update a local account using WinNT on a computer.
Requires 3 Arguments:
[Machine Name] [Local User] [New Password]
?Download SetLocalPassword.vbs
1 2 3 4 5 6 7 | If (WScript.Arguments.Count < 3) Then WScript.Echo "3 Arguments required: [Machine Name] [Local User] [New Password]" WScript.Quit 1 End If Set objUser = GetObject("WinNT://" & WScript.Arguments(0) & "/" & WScript.Arguments(1) & ", user") objUser.SetPassword WScript.Arguments(2) objUser.SetInfo |
231 views



