Hands On with Microsoft Dynamics GP 2018 R2: Create Company Using PowerShell

Microsoft Dynamics GPMicrosoft Dynamics GP 2018 R2 was released on the 2nd October. In this series of posts, I’ll be going hands on and installing the majority of the components; some of them, such as Analysis Cubes for Excel, which are little used, I won’t be covering.

The series index will automatically update as posts go-live in this series.

GP PowerShell can be used to create companies and other actions. The following example shows how GP PowerShell can be used to create a new company:

Administrator: Microsoft Dynamics GP 2018 PowerShell

Add-CompanyDatabase -GPClientDirectory "C:\Program Files (x86)\Microsoft Dynamics\GP2018" -SqlAdmin "sa" -SqlAdminPassword "password" -SqlServerName "SERVER\GP" -CompanyName "azurecurve Publishing" -CompanyDbName "A18R2"-SqlMdfFilePath "C:\SQL Server\Data\" -SqlMdfFileName "GPSA18R2Dat.mdf" -SqlLdfFilePath "C:\SQL Server\Data\" -SqlLdfFileName "GPSA18R2Dat.ldf"

The supplied parameters and their values are:

  • -GPClientDirectory “C:\Program Files (x86)\Microsoft Dynamics\GP2018”
  • -SqlAdmin “sa”
  • -SqlAdminPassword “password”
  • -SqlServerName “SERVER\GP”
  • -CompanyName “azurecurve Publishing”
  • -CompanyDbName “A18R2”
  • -SqlMdfFilePath “C:\SQLServer\Data\”
  • -SqlMdfFileName “GPSA18R2Dat.mdf”
  • -SqlLdfFilePath “C:\SQLServer\Data\”
  • -SqlLdfFileName “GPSA18R2Dat.ldf”

the text between the quotation marks needs to be changed to 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 2018 R2 Series Index