Hands On With Microsoft Dynamics GP 2016 R1: Use Microsoft Dynamics GP PowerShell To Create A Company

Microsoft Dynamics GPMicrosoft Dynamics GP PowerShell has a number of cmdlets which can be used to administer Microsoft Dynamics GP. Before you can use them GP PowerShell needs to be installed.

The following command can be used to return all available cmdlets for Dynamics GP PowerShell:

Get-Command -module GP2016

The following example shows how GP PowerShell can be used to create a new company:

Administrator: Microsoft Dynamics GP 2016 PowerShell
Add-CompanyDatabase -GPClientDirectory "C:\Program Files (x86)\Microsoft Dynamics\GP2016" -SqlAdmin "sa" -SqlAdminPassword "password" -SqlServerName "2016R1-SQL\GP" -CompanyName "azurecurve Publishing" -CompanyDbName "A16R1"-SqlMdfFilePath "C:\SQL Server\Data\" -SqlMdfFileName "GPSA16R1Dat.mdf" -SqlLdfFilePath "C:\SQL Server\Data\" -SqlLdfFileName "GPSA16R1Dat.ldf"

The supplied parameters and their values are:

  • -GPClientDirectory “C:\Program Files (x86)\Microsoft Dynamics\GP2016”
  • -SqlAdmin “sa”
  • -SqlAdminPassword “password”
  • -SqlServerName “2016R1-SQL\GP”
  • -CompanyName “azurecurve Publishing”
  • -CompanyDbName “A16R1”
  • -SqlMdfFilePath “C:\SQLServer\Data\”
  • -SqlMdfFileName “GPSA16R1Dat.mdf”
  • -SqlLdfFilePath “C:\SQLServer\Data\”
  • -SqlLdfFileName “GPSA16R1Dat.ldf”

You would replace the text between the quotation marks with the values you want to use to create the company.

Enter the cmdlet and parameters into GP PowerShell and hit return and the cmdlet will launch GP Utilities and create the new company; if you have any missing parameters or errors the launch will fail (usually with a less than helpful message).

Click to show/hide the Hands On With Microsoft Dynamics GP 2016 R1 Series Index

What should we write about next?

If there is a topic which fits the typical ones of this site, which you would like to see me write about, please use the form, below, to submit your idea.

Your Name

Your Email

Suggested Topic

Suggestion Details

Looking for support or consultancy with Microsoft Dynamics GP?

I no longer work with Microsoft Dynamics GP, but the last company I worked for was ISC Software in the UK; if you’re looking for support or consultancy services with Microsoft Dynamics GP you can contact them here.