HTA Script To Retrieve A Remote SMS Clients Cache Configuration Information

 

This HTA script will take an SMS client machine name from an input text box and then return the SMS clients cache configuration information including its present location, current size and if it is currently in use to the active window.

 

For more information see my post entitled: The SMS Advanced Client Temporary Program Download Folder Cache here:

 

http://myitforum.com/cs2/blogs/dhite/archive/2007/03/24/the-sms-advanced-client-temporary-program-download-folder-cache.aspx

 

 

HTA Script:

 

<Html>

<Head>

<Title>HTA Script</Title>

<Style>

Body {Background-Color: CornSilk}

</Style>

 

<HTA:Application

Caption = Yes

Border = Thick

ShowInTaskBar = No

MaximizeButton = Yes

MinimizeButton = Yes>

 

<Script Language = VBScript>

Sub WindowsLoad

 

strComputer = MachineName.Value

Set objWMIService = GetObject("winmgmts://" & strComputer & "/root/ccm/SoftMgmtAgent")

Set colItems = objWMIService.ExecQuery("Select * from CacheConfig")

For Each objItem in colItems

Window.Document.Title = "Cache Configuration For: " & UCase(strComputer)

strHtml = strHtml & "<td><Font color = Green> Location: </Font></Td>" & objItem.Location & "</Br>"

strHtml = strHtml & "<td><Font color = Green> Size: </Font></Td>" & objItem.Size & " MB" & "</Br>"

strHtml = strHtml & "<td><Font color = Green> In Use: </Font></Td>"  & objItem.InUse & "</Br>"

strHtml = strHtml & "</Br>"

Next

DataArea.InnerHtml = strHtml

 

End Sub

 

</Script><Body>

Enter Machine Name: <Input Type = "Text" Name = "MachineName">

<Input Type = "Button" Value = "Run Script" Name = "Run_Button" onClick = "WindowsLoad"><P>

<Span Id = "DataArea"></Span></Body><Div Align = "Center">

<P><A Href="http://myitforum.com/cs2/blogs/dhite">Created For myITforum By Don Hite</A>

 

 

Published Saturday, March 24, 2007 10:31 AM by dhite
Filed under:

Comments

No Comments