Aussie owned and operated, with 23+ years of industry experience, Gold Coast InfoTech is delighted to support all of your business technology requirements.

Gallery

Contacts

success@goldcoastinfotech.com.au

1800 291 071

KBArticles Scripts, Commands, Registry

SCRIPT: loop through users CN, tsprofile paths and userParameters

‘vbscriptOption ExplicitDim objCommand, objConnection, strBase, strFilter, strAttributes, objUserDim strQuery, objRecordset, strdistinguishedName, strTSPath, strCN, objFSO, Set objCommand = CreateObject(“ADODB.Command”)Set objConnection = CreateObject(“ADODB.Connection”)objConnection.Provider = “ADsDSOObject”objConnection.Open “Active Directory Provider”objCommand.ActiveConnection = objConnectionConst ForWriting = 2‘…set the base DNstrBase = “<ldap://DC=domain,DC=/local>”strFilter = “(&(objectCategory=person)(objectClass=user))”strAttributes = “sAMAccountName,cn,distinguishedName”strQuery = strBase & “;” & strFilter & “;” & strAttributes & “;subtree”objCommand.CommandText = strQueryobjCommand.Properties(“Page Size”) […]

KBArticles Scripts, Commands, Registry

SCRIPT: query server uptime output to text file

‘vbscript ‘list computers to check in com,puters.txt in same directory script is run from ‘will write server uptime to uptime.txt in same directory rfile = “computers.txt” wfile = “Uptime.txt” on error resume next Const ForReading = 1 Const ForWriting = 2 Const ForAppending = 8 Set objFSO = CreateObject(“Scripting.FileSystemObject”) Set r = objFSO.OpenTextFile(rfile, ForReading, True) […]

KBArticles Scripts, Commands, Registry Uncategorized

SCRIPT: check if folder is empty

‘vbscriptOption ExplicitDim oFS : Set oFS = CreateObject(“Scripting.FileSystemObject”)Function FolderEmpty(strFolderPathName) Dim oFiles, oFile, oFolder, oSubFolders, oSubFolder Dim blnFileFound : blnFileFound = False Set oFolder = oFS.GetFolder(strFolderPathName) Set oFiles = oFolder.Files If oFiles.Count > 0 Then  FolderEmpty = False  Exit Function End If Set oSubFolders = oFolder.SubFolders For Each oSubFolder In oSubFolders  If Not FolderEmpty(oSubFolder.Path) Then   FolderEmpty = False   Exit Function  End If Next FolderEmpty = TrueEnd FunctionDim strFolderPathName1 : strFolderPathName1 = “file://server/c$/folder“If […]

KBArticles Scripts, Commands, Registry Uncategorized

SCRIPT: check Xen servers logons enabled

‘vbscriptconst HKEY_LOCAL_MACHINE = &H80000002 Dim oReg, strKeyPath, strValueName, strDisabled, objArgs, strComputer, arrComputersSet objArgs = WScript.Arguments arrComputers = Array(“server1″,”server2”) sOutput = “Logons Enabled(0) or Disabled(1)” & VBCRLF & VBCRLFFor EACH strComputer in arrComputers Set oReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\” & strComputer & “rootdefault:StdRegProv”)  strKeyPath = “SoftwareMicrosoftWindows NTCurrentVersionWinlogon”  strValueName = “WinStationsDisabled”  oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strDisabled  sOutput = sOutput & strcomputer & ”    ” & […]

KBArticles Scripts, Commands, Registry Uncategorized

SCRIPT: set citrix xenapp XML to trusted for localhost

‘vbscriptOption ExplicitDim WSHShellDim objNTInfoDim GetComputerNameDim xmlConst MetaFrameWinSrvObject = 6Set objNTInfo = CreateObject(“WinNTSystemInfo”)GetComputerName = lcase(objNTInfo.ComputerName)Set WSHShell = WScript.CreateObject(“WScript.Shell”)Set xml=CreateObject(“MetaframeCOM.Metaframeserver”)xml.initialize MetaFrameWinSrvObject,GetComputerName‘xml.initialize MetaFrameWinSrvObject,”servername”xml.WinServerObject.TrustXMLRequests = 1WScript.Quit