Importing through PowerShell

A PowerShell cmdlet (import - servicemanagerdata) is included with Data Management. The cmdlet allows you to import data from a command line into Service Manager objects. Using PowerShell 2.0 you can schedule data imports into Service Manager from other systems. You must understand how to use PowerShell and have an existing import template stored in Data Management that can be used to map the import data.

The form of import chosen — csv or SQL Server — is determined by the parameters included in the command line call (parameter set). The default parameter set is for a csv import. If no parameter set is specified, PowerShell requests values for the mandatory csv import parameters.

To run the PowerShell cmdlet:

  1. On the Service Manager management server where you installed the Data Management pack, click the Start menu and search for the Provance folder.

  2. Open the Provance folder and click Provance Data Management Shell. A command prompt opens with the cmdlet loaded.

  3. Enter the import-servicemanagerdata command and its parameters to run the cmdlet. For more details, see Sample cmdlet calls.

NOTE:

If you wish to run the cmdlet from a command prompt without directly access­ing the management server, it needs to be loaded first, see To load the PowerShell cmdlet:.

To load the PowerShell cmdlet:

If you do not run the cmdlet from the Start menu, it needs to be loaded before you can use it. When loaded in this fashion the cmdlet does not per­sist between sessions; it must be re-loaded for use in every new session.

•      Place the module folder \Program Files\Microsoft System Center\Service Manager 2012\Provance\Provance.ServiceManager.Integration.Cmdlets, within one of the PowerShell module paths and run Import-Module Provance.ServiceManager.Integration.Cmdlets. The environment variable psmod­ulepath contains the paths for PowerShell.

OR

•     Place the module folder Provance.ServiceManager.Integration.Cmdlets where you wish, take note of the path from the root directory, and run Import-Module "{your path}\Provance.ServiceManager.Integration.Cmdlets