VB script to force a client update and send a basic inventory

book

Article ID: 180327

calendar_today

Updated On:

Products

Management Platform (Formerly known as Notification Server)

Issue/Introduction

 

Resolution

Question

Is there a script I can use to force a client update and send a basic inventory?

Answer
This is a Visual Basic script to force a client to request a update and send basic inventory.

'**** Force a client to request a update and send basic inventory ****

Dim fso_obj, client

Set fso_obj = CreateObject("Scripting.FileSystemObject")

Wscript.Echo "Starting script to have a client policy refresh and send basic inventory"

'**** Kick off client policy refresh and send basic inventory ****

If (fso_obj.FileExists("C:\Program Files\Altiris\Altiris Agent\AexNSAgent.exe")) or (fso_obj.FileExists("C:\Program Files\Altiris\eXpress\NS Client\AexNSAgent.exe")) Then

set client = wscript.createobject ( "Altiris.AeXNSClient" )

ignoreBlockouts = 1

sendIfUnchanged = 1

client.UpdatePolicies ignoreBlockouts

client.SendBasicInventory sendIfUnchanged, ignoreBlockouts

Wscript.Echo "Client policy refresh and send basic inventory"

set client = nothing

Else

Wscript.Echo "AexNSAgent.exe does not exist in this location"

End if

set fso_obj = nothing

Wscript.quit