IsSlowLink by Shaun Vermaak is an utility that returns Error Code 1 if slow link detected
Publishers website: http://www.ittelligence.co.za
ITtelligence mirror: IsSlowLink.zip (8.43 Kb)
Usage: IsSlowLink.exe HOSTNAMEORADDRESS MAXROUNDTRIPTIME
ITtelligence Everywhere
IsSlowLink by Shaun Vermaak is an utility that returns Error Code 1 if slow link detected
Publishers website: http://www.ittelligence.co.za
ITtelligence mirror: IsSlowLink.zip (8.43 Kb)
Usage: IsSlowLink.exe HOSTNAMEORADDRESS MAXROUNDTRIPTIME
Posted in Development.
– July 22, 2010
Tools required
7za.exe – Standalone 7z command-line tool
RoboCopy.exe – Robust copying tool from MS Resource Kit
PSExec.exe – Remote process execution tool from Sysinternals
Steps
1. Compress and span data that you wish to transmit. Compressing obviously reduces the size of data that needs to be transferred and spanning data over a number of small files means that the checkpoint for each copy is reached easier and fewer bits are retransmitted.
7za.exe a -v102400 [ARCHIVENAME].7z “[PATHTOCOMPRESS]“
2. RoboCopy spanned archives to target host The /IPG interpacket gap setting of a 100 seems to reduce the amount of recopies. RoboCopy is a good tool for copying files in general but it still couldn’t transfer the large files that where required without breaking it into 100KB chunks.
RoboCopy.exe “\\[TARGETHOST]\C$\Temp” *.7z.* /zb /w:3 /ipg:100
3. RoboCopy.exe 7za.exe to target host. This standalone is required to extract spanned archive.
RoboCopy .exe “\\[TARGETHOST]\C$\Windows” 7za.exe /zb /w:3 /ipg:100
4. Execute 7za.exe remotely with PSExec.exe.
Psexec.exe \\ [TARGETHOST] -d 7za.exe e C:\Temp\[ARCHIVENAME].7z.001 -aoa -o”PATHTODECOMPRESS”
Automated in a batch
REM ******** Start of CopyData.bat **********
@Echo Off
del *.7z.*
7za a -v102400 %2.7z “%3″
robocopy . “\\%1\c$\Temp” *.7z.* /zb /w:3 /ipg:100
robocopy . “\\%1\c$\Windows” 7za.exe /zb /w:3 /ipg:100
psexec \\%1 -d 7za e C:\Temp\%2.7z.001 -aoa -o”%4″
REM ******** End of CopyData.bat **********
Usage: CopyData.bat HOSTNAME ARCHIVENAME SOURCEFOLDER DESTINATIONFOLDER
Posted in Scripts.
– June 16, 2010
WSUS_Get_Status by Shaun Vermaak is an utility to get the UpdatesNeedingFilesCount value from a remote WSUS server…
Remember to have “Microsoft.UpdateServices.Administration.dll” in path
Added last sync status
Publishers website: http://www.ittelligence.co.za
ITtelligence mirror: WSUS_Get_Status.zip (8.57 KB)
Usage: WSUS_Get_Status.exe SERVERNAME USESECURECONNECTION PORT
Posted in Development.
– April 23, 2010
Enumerate All Empty Active Directory Groups
The following script was created to enumerate all the empty groups that exist in an Active Directory.
This output of the script can be piped to a text file.
Basic steps are
1) Create connection to Active Directory domain
2) Create recordset from query, filtering in only empty groups
3) Enumerate through recordset, displaying name of group
4) Cleanup
* * * * * * * * * * Start of GetEmptyADGroups.vbs * * * * * * * * * *
Option Explicit
On Error Resume Next
Dim objCommand
Dim objConnection
Dim objRootDSE
Dim strDNSDomain
Dim strBase
Dim objSystemInfo
Dim strDomain
Dim strFilter
Dim strAttributes
Dim strQuery
Dim objRecordset
Dim strGroupName
Set objCommand = CreateObject(“ADODB.Command”)
Set objConnection = CreateObject(“ADODB.Connection”)
objConnection.Provider = “ADsDSOObject”
objConnection.Open “Active Directory Provider”
objCommand.ActiveConnection = objConnection
Set objRootDSE = GetObject(“LDAP://RootDSE”)
strDNSDomain = objRootDSE.Get(“defaultNamingContext”)
strBase = “”
Set objSystemInfo = CreateObject(“ADSystemInfo”)
strDomain = objSystemInfo.DomainShortName
strFilter = “(&(objectCategory=group)(!member=*))”
strAttributes = “sAMAccountName”
strQuery = strBase & “;” & strFilter & “;” & strAttributes & “;subtree”
objCommand.CommandText = strQuery
objCommand.Properties(“Page Size”) = 100
objCommand.Properties(“Timeout”) = 30
objCommand.Properties(“Cache Results”) = False
Set objRecordset = objCommand.Execute
Do Until objRecordset.EOF
strGroupName = objRecordset.Fields(“sAMAccountName”).Value
WScript.Echo strGroupName
objRecordset.MoveNext
Loop
objRecordset.Close
objConnection.Close
Set objRecordset = Nothing
Set objSystemInfo = Nothing
Set objRootDSE = Nothing
Set objConnection = Nothing
Set objCommand = Nothing
Publishers website: http://www.ittelligence.co.za
ITtelligence mirror: GetEmptyADGroups.zip (697 B)
* * * * * * * * * * End of GetEmptyADGroups.vbs * * * * * * * * * *
Posted in Scripts.
– January 12, 2010
Recreate DNS Hosts From Export File Into a Microsoft DNS Server
The following script was created to add hosts, from a list of exported hosts and IPs originally from a unrelated DNS server’s zone, into the specified Microsoft DNS server’s DNS zone.
The basic usage of the script is:
CScript AddDNSHost.vbs /DNSServer:DNSServer /DNSZone:DNSZone /HostName:HostName /HostIP:HostIP
And an example:
AddDNSHost.vbs /DNSServer:192.168.0.1 /DNSZone:DNSZone.local /HostName:MyComputer /HostIP:192.168.1.123
A very simple way of constructing multiple commands can be achieved with practically any speadsheet application where column A holds the list of host names, column B holds their respected IP addresses and column C the following command (starting from row 1):
=”AddDNSHost.vbs /DNSServer:192.168.0.1 /DNSZone:DNSZone.local /HostName:” & A1 & ” /HostIP:” & B1
The above command can be copied once for each row.
The resulting constructed command can then be directly pasted into a command prompt
‘* * * * * * * * * * * Start of AddDNSHost.vbs * * * * * * * * * * *
On Error Resume Next
strDNSServer = Wscript.Arguments.Named(“DNSServer”)
strDNSZone = Wscript.Arguments.Named(“DNSZone”)
strHostName = Wscript.Arguments.Named(“HostName”)
strHostIP = Wscript.Arguments.Named(“HostIP”)
If Len(Trim(strDNSServer)) > 0 And Len(Trim(strDNSZone)) > 0 And Len(Trim(strHostName)) > 0 And Len(Trim(strHostIP)) > 0 Then
If Right(UCase(strHostName), Len(strDNSZone) + 1) “.” & UCase(strDNSZone) Then
strHostName = strHostName & “.” & strDNSZone
End If
intRecordClass = 1
intTTL = 600
strComputer = “.”
Set objWMIService = GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” & strComputer & “\root\MicrosoftDNS”)
Set objItem = objWMIService.Get(“MicrosoftDNS_AType”)
intReturn = objItem.CreateInstanceFromPropertyData(strDNSServer, strDNSZone, strHostName, intRecordClass, intTTL, strHostIP)
If Err.Number = 0 And intReturn = 0 Then
WScript.Echo strHostName & vbTab & “Added”
Else
WScript.Echo strHostName & vbTab & “Failed”
End If
End If
‘* * * * * * * * * * * Start of AddDNSHost.vbs * * * * * * * * * * *
Publishers website: http://www.ittelligence.co.za
ITtelligence mirror: AddDNSHost.zip (641 B)
Posted in Scripts.
– November 7, 2009