'Declare global variables dim objNSE, objDCInstance, objDataClass Dim arrMembership, arrCols() arrMembership = GetGroupMembership("Remote Desktop Users") Redim arrCols(UBound(arrMembership)) dim intMembers, arrRow(1), arrUser For intMembers = 0 to uBound(arrMembership) 'Populate Values arrUser = split(arrMembership(intMembers), "\") arrRow(0) = arrUser(1) arrRow(1) = arrUser(0) 'Add Row to arrCols arrCols(intMembers) = arrRow Next 'Create instance of Altiris NSE component set objNSE = WScript.CreateObject ("Altiris.AeXNSEvent") ' Set the header data of the NSE ' Please don't modify this GUID objNSE.To = "{1592B913-72F3-4C36-91D2-D4EDA21D2F96}" objNSE.Priority = 1 'Create Inventory data block. Here assumption is that the data class is already configured on server set objDCInstance = objNSE.AddDataClass("Remote Desktop Group") ' -THIS IS THE NAME OF THE DATACLASS set objDataClass = objNSE.AddDataBlock(objDCInstance) Dim intCol For intCol = 0 to uBound(arrCols) AddInventoryRow(arrCols(intCol)) Next ' Send the NSE data to the NS server objNSE.SendQueued 'Functions down here to make it easier to understand Function GetGroupMembership(strGroupName) 'Returns an array with members of a given local group in format Domain\UserName dim colGroups, objGroup, objUser, strUsers strUsers = "" Set colGroups = GetObject("WinNT://.") colGroups.Filter = Array("group") For Each objGroup In colGroups If objGroup.Name = strGroupName Then For Each objUser in objGroup.Members dim strUser 'strUser = objUser.Name strUser = objUser.adsPath strUser = replace(replace(strUser, "WinNT://", ""), "/", "\") If strUsers = "" Then strUsers = strUser Else strUsers = strUsers & "," & strUser End If Next End If Next dim arrUsers arrUsers = split(strUsers, ",") GetGroupMembership = arrUsers End Function Sub AddInventoryRow(arrData) 'Add a new row dim objDataRow set objDataRow = objDataClass.AddRow Dim intCols For intCols = 0 To uBound(arrData) objDataRow.SetField intCols, ToXmlString(arrData(intCols)) Next End Sub 'Internal Functions Function ToXmlString(strInput) Dim strOutput If (IsNull(strInput)) Then ToXMLString = strInput Else strOutput = Replace(strInput, "&", "&") strOutput = Replace(strOutput, """", """) strOutput = Replace(strOutput, "<", "<") ToXmlString = Replace(strOutput, ">", ">") End If End Function