Commerce Server Resource CmdLets

Commerce Server Resources are the various subsystems that you can add to a Commerce Site, such as catalog, inventory, orders, marketing, and profiles. You can choose which resources you add initially, and add more resources at a later date.

You can add resources to an existing site by running the following commands:

Add-CSCatalogResource MySiteName
Add-CSInventoryResource MySiteName
Add-CSMarketingResource MySiteName
Add-CSOrdersResource MySiteName
Add-CSProfilesResource MySiteName

To create all of the resources, run the following command:

Add-CSResources MySiteName 

By default, these CmdLets will create the associated resource databases on the same database server as the MSCS_Admin database, using default naming conventions. You can override all of these defaults. For example:

Add-CSCatalogResource -Name "MySiteName" -DatabaseName "MyDatabase"Add-CSCatalogResource -Name "MySiteName" -ConnectionString "Provider=SQLOLEDB;Persist SecurityInfo=False;Integrated Security=SSPI;Initial Catalog=mydatabase;Data Source=MY-SERVER"

You can remove a resource from a site by running the following commands:

Remove-CSCatalogResource MySiteName
Remove-CSInventoryResource MySiteName
Remove-CSOrdersResource MySiteName
Remove-CSMarketingResource MySiteName
Remove-CSProfilesResource MySiteName

By default, the remove commands will not delete the associated database. You can delete the associated database at the same time by adding the DeleteDatabases parameter:

Remove-CSCatalogResource -Name MySiteName -DeleteDatabases $true

Because profiles on a Commerce Server site are a link to a Global Resource, Remove-CSProfilesResource also gives you the option to delete the associated Global Resource.

Remove-CSProfilesResource -Name MySiteName -DeleteGlobalResources $false -DeleteDatabases $true

If you need to find out what Commerce Server resources are associated with a Commerce Server site, run the following command:

Get-CSSiteResources MySiteName

All resources contain a collection of properties that allow you to configure how the resource runs. You can manipulate these properties using CmdLets.

To get a list of all of the properties on a resource run the following command:

Get-CSSiteResourceProperties -Name MySiteName -Resource Catalog

To get a specific property value, run the following command:

Get-CSSiteResourceProperty -Name MySiteName -Resource "Product Catalog" -PropertyName connstr_desc_Catalog

To set a property value, run the following command:

Set-CSSiteResourceProperty -Name MySiteName -Resource "Product Catalog" -PropertyName connstr_desc_Catalog -PropertyValue “Connection string to catalog database”

For more details on any of the previous CmdLets, run the following command:

Get-Help -detailed CmdLet-Name