Tags » VBScript

Monitor a workstation for package arrival (local)

When you are waiting for a package to arrive and process at a workstation, this script will notify you when the Referenced CacheElements count changes. 1,712 more words

VBScript

Installing Oracle, with some tricks along the way

This routine will install Oracle from a network location, and also copy some files, and put some things into the registry.  It is fully logged and includes some error checking. 1,067 more words

VBScript

Writing a big number

Sometimes I want to make a number stand out, so I wanted a routine to write a big number.  I mean, a large-format display.  Here’s the routine. 109 more words

VBScript

audit / remediate outdated profile

Using SCCM and compliance settings, you want to search for old profiles (unused for 90 days).  You want to make sure only Domain (not local ) account profiles are wiped out.  1,611 more words

VBScript

Framework for working with SCCM cache

Work in progress

 - run at workstations
' Script to Clear SMS cache files
'on error resume next
dim oUIResManager
dim oCache
dim oCacheElement
dim oCacheElements
set oUIResManager = createobject("UIResource.UIResourceMgr")
if oUIResManager is nothing then
      wscript.echo "Couldn't create Resource Manager - quitting"
     wscript.quit
end if

'---[ read the number of items in the cache
set oCache=oUIResManager.GetCacheInfo()
if oCache is nothing then
     set oUIResManager=nothing
      wscript.echo "Couldn't get cache info - quitting"
     wscript.quit
end if
set oCacheElements=oCache.GetCacheElements
wscript.echo "There are " & oCacheElements.Count & " cache elements"

'---[ read the names of the the applicaitons items in the cache
set oCache=oUIResManager.GetAvailableApplications()
if oCache is nothing then
     set oUIResManager=nothing
      wscript.echo "Couldn't get available applications info - quitting"
     wscript.quit
end if
wscript.echo "There are " & oCache.Count & " Applications"
for i = 1 to oCache.Count
	wscript.echo "---" & oCache.item(i).name
next 


' ***** Begin CLEAR CACHE *****
' for each oCacheElement in oCacheElements
' 	oCache.DeleteCacheElement(oCacheElement.CacheElementID)
' next
' ***** End CLEAR CACHE *****
' ***** Clean up *****

set oCacheElements=nothing
set oUIResManager=nothing
set oCache=nothing
VBScript

Scheduled Task for WOL magic packets

Based on the systems in a collection, this will wakeup all of them using the 1E server.

This depends on the 1E server to be installed – it won ' NAME: 1EWakeup_Collection ' ' Roger C 5/20/2017 ' ' COMMENT: read a collection from SCCM, and fire wakeup commands to the collection members ' intended to be scheduled to run on the server using scheduled task manmager 'the collection can be read form the command line, or hard coded into the script '========================================================================== Option Explicit DIM Version: Version = "1.2.0.1" Dim strSCCMServer 'strComputer, dim oWMI, strSCCM_SiteName, strQuery, objWMIService, strWMIClass Dim colItems, objItem, strCollectionID, strNameSpace Dim i, bBatch, s_csv dim AwakeCount, AsleepCount Dim locator, services, WakeService Dim LogFileHandle, LogFilename, objFile Const wbemFlagReturnImmediately = &h10 Const wbemFlagForwardOnly = &h20 dim wshShell: Set wshShell = WScript.CreateObject("WScript.Shell") LogFilename = "WakeupLog.log" 'Edit for your SCCM Server strSCCMServer = "ORSCCM02" strSCCM_SiteName = "site_OR2" ' strCollectionID = "OR200017" ' All Windows 7 Computers collection strCollectionID = "OR20016A" ' small sample collection - just my tablet if WScript.Arguments.Count >= 1 then if WScript.Arguments.Item(0) <> "" then strCollectionID = WScript.Arguments.Item(0) End if end if '============================================================================================= ' Make sure this is running from the cscript scripting host, to avoid popups '============================================================================================= 'If (Not IsCScript()) Then 'If not CScript, re-run with cscript... 1,074 more words

VBScript