Custom Reports - Group Object

avatar

Hi, when building a custom report with the Macros/Scripts/Tools, I'm trying to extract specific data out of a Group object. If I right click on the Group object, I see the XML includes my web URL, contact object, RDP session, etc.

I start my script with the following:

Foreach($connection in $Report.Connections){
if($connection.GroupDetails.GroupType -eq "Company"){
$Report.NewRow();

I'm able to grab the object correctly as I can pull the info from the main object, but I can't seem to figure out how to get the details from it for the other objects as they are all enclosed in the same <Connection></Connection> parameters as the main object. I'm trying to create report with all the details for each company.

Here's a snippet of what the XML looks like:

<?xml version="1.0"?>
<ArrayOfConnection>
<Connection>
<ConnectionType>Group</ConnectionType>
<CreatedBy>ME</CreatedBy>
<CreationDateTime>2017-10-19T20:18:03</CreationDateTime>
<CredentialConnectionID>B87B29D9-9239-4D7B-86D8-9B53DCD3BA9F</CredentialConnectionID>
<Group>ABCD</Group>
<ID>6bdc5708-6011-46cb-ba1c-ed44e69e612c</ID>
<Name>ABCD</Name>
<Stamp>a9ff2d34-b123-493b-8e5c-68fa39d9c08f</Stamp>
<UpdateDateTime>2020-08-20T18:05:37</UpdateDateTime>
<UpdatedBy>DESKTOP</UpdatedBy>
<GroupDetails>
<GroupType>Company</GroupType>
</GroupDetails>
</Connection>
<Connection>
<WebBrowserUrl>https:/abcd.com/</WebBrowserUrl>
<ConnectionSubType>Default</ConnectionSubType>
<ConnectionType>WebBrowser</ConnectionType>
<CreatedBy>ME</CreatedBy>
<CreationDateTime>2017-10-19T20:25:48</CreationDateTime>
<Description>Webclient</Description>
<Group>ABCD</Group>
<ID>2ad0232a-3ad6-4b10-be04-066e8458e976</ID>
<Name>Website</Name>
<Stamp>cd6b1691-ce4d-4d96-9639-00b255596136</Stamp>
<TemplateSourceID>00f1c015-01ca-4de0-88de-86928d488ca0</TemplateSourceID>
<UpdateDateTime>2020-08-20T18:05:37</UpdateDateTime>
<UpdatedBy>DESKTOP</UpdatedBy>
<MetaInformation>
<PasswordHistory>
<PasswordHistory>
<ModifiedBy>ME</ModifiedBy>
<ModifiedDateTime>2017-10-19T16:25:48</ModifiedDateTime>
<SafePassword>XXXXXX</SafePassword>
</PasswordHistory>
</PasswordHistory>
</MetaInformation>
<Web>
<FormId>form1</FormId>
<PasswordControlId>Login1_Password</PasswordControlId>
<SafePassword>XXXXXX</SafePassword>
<SubmitControlId>Login1_Login</SubmitControlId>
<UserName>XYZ</UserName>
<UserNameControlId>Login1_UserName</UserNameControlId>
</Web>
</Connection>
<Connection>
<Url>ServerName</Url>
<UsesHardDrives>false</UsesHardDrives>
<ConnectionType>RDPConfigured</ConnectionType>
<CreatedBy>ME</CreatedBy>
<CreationDateTime>2017-10-17T14:21:32</CreationDateTime>
<CreationSource>CSV</CreationSource>
<Description>Remote Desktop</Description>
<Group>ABCD</Group>
<ID>a647b018-05e6-43ee-8302-93c1bb50852f</ID>
<Name>Remote Desktop</Name>
<PingConnectionMethod>PortScan</PingConnectionMethod>
<PingConnectionMode>On</PingConnectionMode>
<Stamp>b5aa367d-e630-4432-b3c2-ad219ae3996f</Stamp>
<UpdateDateTime>2020-09-03T19:51:42</UpdateDateTime>
<UpdatedBy>ME</UpdatedBy>
<MetaInformation>
<CustomField1Title>License</CustomField1Title>
<CustomField1Value>A</CustomField1Value>
<CustomField2Title>Counts</CustomField2Title>
<CustomField2Value>2</CustomField2Value>
<Email>bob@gmail.com</Email>
<FirstName>Bob</FirstName>
<IP>1.2.3.4</IP>
<LastLoadFromInventoryDate>2020-07-08T14:12:57.8058456-04:00</LastLoadFromInventoryDate>
<LastName>Smith</LastName>
<Memory>0.00 GB</Memory>
<VirtualMachineType>Azure</VirtualMachineType>
</MetaInformation>
<RDP>
<Domain>MNO</Domain>
<GatewayDomain>MNO</GatewayDomain>
<GatewayHostname>MNO.com</GatewayHostname>
<GatewayProfileUsageMethod>Explicit</GatewayProfileUsageMethod>
<GatewaySelection>SpecificGateway</GatewaySelection>
<GatewayUserName>bob</GatewayUserName>
<KeyboardLayoutText>Default</KeyboardLayoutText>
<PromptCredentialOnce>true</PromptCredentialOnce>
<UserName>bob</UserName>
</RDP>
</Connection>

All Comments (1)

avatar

Hello,

The if statement used in your report will only list Company Folder type entries. Not their children entries.
if ($connection.GroupDetails.GroupType -eq "Company")

The following Custom Report attached to this post (List objects.rdm) entry should help to get what you want as it contains additional instructions to list children entries.

Best regards,

Érica Poirier

List objects.rdm