Tags » VBScript

Reinstall Qualys Agent, giving a new ActivationID

When a qualys agent needs to be reinstalled, it will try to reuse it’s HostID.  This routine reinstalls while deleting the HostID, and also support using a different ActivationdID. 1,701 more words

Tips And Tricks

SCCM Client Repair Script

I’m periodically tasked to identify and attempt to repair computers with SCCM client issues. How I identity problem computers is a subject for another post, but for now I’d just like to share the method I use to repair those clients that need attention. 862 more words


Test for PKI accessibility

This is for auditing PKI access. Used when PKI infrastructure in not properly routed due to firewall blocking.


Set DDE for all user profiles per QID110307

This loops through the user keys and adds/changes values to match the Microsoft recommendations.


'Program: OFFICE_Remediate_QID110307.vbs
'Purpose: Registry tweaks to manage DDE settings
' Author: Roger C 1/29/2019
' Last Updated 29-Jan-2018 v1.0.0.0
' Logic: 
'			Loop through the registry to find every user in the HKEY_USERS hive
'			Change the registry values

'	 WorkbookLinkWarnings(DWORD) = 2
'	 DontUpdateLinks(DWORD)= 1
'	 DontUpdateLinks(DWORD)= 1
'	https://technet.microsoft.com/en-us/library/security/4053440

option explicit

'===[ Declare variables ]===

'Reqired for advanced logging
Dim LogFileHandle, objFSO, objNetwork, ScriptUser, ScriptComputer
Dim MaxLogFileSize : MaxLogFileSize = 10000
Dim LogFilenamePath : LogFilenamePath = ".\"

Dim TargetKeys(3,3) ' 3 rows, col1=key  col2=value   col3=Data
TargetKeys(1,1) = "Software\Microsoft\Office\16.0\Excel\Security"
TargetKeys(1,2) = "WorkbookLinkWarnings"
TargetKeys(1,3) = 2

TargetKeys(2,1) = "Software\Microsoft\Office\16.0\Word\Options\WordMail"
TargetKeys(2,2) = "DontUpdateLinks"
TargetKeys(2,3) = 1

TargetKeys(3,1) = "Software\Microsoft\Office\16.0\Word\Options"
TargetKeys(3,2) = "DontUpdateLinks"
TargetKeys(3,3) = 1

Const HKLM          = &H80000002
Const HKU		 	= &H80000003

' This code handles 32 64 bit issues for x64 systems. 917 more words

Rename outdated flash OCX files

Qualys identifies that old flash.ocx files expose vulnerabilities. this scrip twill rename the offending file(s).

' Purpose: 	If an outdated version of Flash*.ocx is in the folder, rename it
'			Check both 32 and 64 bit folders
Option Explicit
Dim ScriptVersion : ScriptVersion = ""

Const TargetVersion = "" ' file needs remediation If version is this or earlier

'Reqired for advanced logging
Dim LogFileHandle, objNetwork, ScriptUser, ScriptComputer
Dim objFSO, objFolder, objFile
Dim MaxLogFileSize : MaxLogFileSize = 10000
Dim LogFilenamePath : LogFilenamePath = ".\"
Dim I, FileVersion, Filename, NewFilename

dim Folder(2)
Folder(1) = "c:\windows\system32\Macromed\Flash"
Folder(2) = "c:\windows\syswow64\Macromed\Flash"

Set objFSO = CreateObject("Scripting.FileSystemObject")

LogWriteln("Goal: Remediate any FLASH*.OCX file with file version " & TargetVersion & " or less")

for I = 1 to 2
	LogWriteln("Searching " & Folder(I))
	Set objFolder = objFSO.GetFolder(Folder(I))
	For Each objFile in objFolder.Files
		If left(ucase(objFile.Name),5) = "FLASH" and UCase(objFSO.GetExtensionName(objFile.Name)) = "OCX" Then ' If we are interested in the file
			Filename = Folder(I) & "\" & objFile.Name
			FileVersion = objFSO.GetFileVersion( Filename) ' get the file version
			'Wscript.Echo Filename & " - "& FileVersion
			LogWriteln("     Found: " & Filename &" - "& FileVersion)
			If Version_is_Greater(FileVersion, TargetVersion) Then
				LogWriteln("     --- File is OK")
				LogWriteln("     --- File requires remediation")
				NewFilename = Filename & ".QID_remediate"
				'LogWriteln("     --- New filename is " & NewFilename)
				If objFSO.FileExists(NewFilename) Then 
					LogWriteln("     --- There is already a file named " & NewFilename)
					LogWriteln("     --- Deleting file " & Filename)
					If objFSO.FileExists(Filename) Then
						LogWriteln("     --- Rename file operation failed!")
						LogWriteln("     --- Success. 525 more words

Get Network Address using VBScript


Like everyone else took a boat load of CISCO Networking classes.  Took night classes at the local community college.

Forgot about it.

But, then last week a Network Engineer asked me what is my network address and I just did not know. 758 more words


VBScript – Sample Microsoft Office Access ( MS Access ) App


Here is a code snippet for using VBScript to develop a small application that connects to MS Access database.

BTW, the MS Access database was created using the Create Database Wizard in Access. 440 more words