Keep up to date with the latest information about Microsfot Dynamics GP through articles from the Perfect Image and azurecurve blog.
Hands On with Microsoft Dynamics GP 2018 R2: Create Company Using PowerShell
November 5th, 2018 by
Microsoft 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:
Add-CompanyDatabase -GPClientDirectory "C:Program Files (x86)Microsoft DynamicsGP2018" -SqlAdmin "sa" -SqlAdminPassword "password" -SqlServerName "SERVERGP" -CompanyName "azurecurve Publishing" -CompanyDbName "A18R2"-SqlMdfFilePath "C:SQL ServerData" -SqlMdfFileName "GPSA18R2Dat.mdf" -SqlLdfFilePath "C:SQL ServerData" -SqlLdfFileName "GPSA18R2Dat.ldf"
The supplied parameters and their values are:
- -GPClientDirectory “C:Program Files (x86)Microsoft DynamicsGP2018”
- -SqlAdmin “sa”
- -SqlAdminPassword “password”
- -SqlServerName “SERVERGP”
- -CompanyName “azurecurve Publishing”
- -CompanyDbName “A18R2”
- -SqlMdfFilePath “C:SQLServerData”
- -SqlMdfFileName “GPSA18R2Dat.mdf”
- -SqlLdfFilePath “C:SQLServerData”
- -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).