Compartir a través de


Service Manager - CMDB Computer Maker

An example PowerShell script to automate the creation of items within the Service Manager CMDB can be downloaded from https://gallery.technet.microsoft.com/scriptcenter/Service-Manager-CMDB-c8628456. This shows how to easily populate information when SCCM connector usage is not appropriate for the task. The script creates and populates the computer Configuration Item in Service Manager via the CSV file import process detailed here https://blogs.technet.com/b/servicemanager/archive/2010/09/24/importing-computers-via-csv.aspx.

Step 1
Download and unzip the attached file on computer with Service Manager PowerShell cmdlets installed and connection to Service Manager.

 

Step 2
Import the DeviceProjectionMP.xml Management pack located in the Management Pack folder into your Service Manager test environment, This defines a new type projection to allow Software to be imported and linked to the computer CI. Further documentation on this MP can be located at https://blogs.technet.com/b/servicemanager/archive/2010/09/27/importing-software-related-to-computers-via-csv.aspx   

 

Step 3                                                                                                                                                                                                                                                                                          Edit servers.csv in folder and enter computers you wish to get asset information from. For local computer use "localhost". 

 

Step 4                                                                                                                                                                                                                                                                                Run CMDBCompMaker.ps1 from folder location in Step 1

Select "Collect data" and enter credentials for computers to be audited.

When completed you should now see .csv files generated in folder as below

Step 5                                                                                                                                                                                                                                                                           Run CMDBCompMaker.ps1 again with an account that has permissions to add CIs to SCSM and select "Import into SCSM" and this will now copy .csv files into data files directory and apply formatting. The script then contacts service manager and performs .csv import against format files. The import can then be confirmed via the Service Manager console > computers > Configuration Items.