Query the CMDB with PowerShell

With XIA Configuration Server version 6.2 we're now directly supporting the use of PowerShell to query the CMDB.

The following very simple example generates a PDF document for an item and opens the file in the default PDF document viewer.

  • In the example the PDF is generated for the item with ID 1031, however any valid item ID may be used. 
  • The output is returned from the server as a byte[] array, this is then saved to the filesystem before opening. In the example the file is saved to "c:\temp\sample.pdf", however any valid path may be used. 



Code Sample
Write-Host "Getting PDF data..."
$filename = "c:\temp\sample.pdf"
$binaryData = $xia.GET_PDFOutputBasic(1031)
[IO.File]::WriteAllBytes($filename,$binaryData)
[System.Diagnostics.Process]::Start($filename


Output





For more information see the PowerShell page of our web site
http://www.centrel-solutions.com/XIAConfiguration/features.aspx?feature=PowerShell

Or view the full documentation in the Administrator's Guide

Comments

Popular posts from this blog

Windows Server 2016, 2019, 2022, Windows 10 and Windows 11: Date and time "Some settings are managed by your organization".

TFTPD32 or TFTPD64 reports Bind error 10013 An attempt was made to access a socket in a way forbidden by its access permissions.

Windows Server 2019 desktop icons such as My Computer, Windows cannot access the specified device, path, or file.