Commerce Server Resource CmdLets

Current version: 8.2

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:

RequestResponse

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:

RequestResponse

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:

RequestResponse

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:

RequestResponse

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:

RequestResponse

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.

RequestResponse

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:

RequestResponse

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:

RequestResponse

Get-CSSiteResourceProperties -Name MySiteName -Resource Catalog

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

RequestResponse

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

To set a property value, run the following command:

RequestResponse

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:

RequestResponse

Get-Help -detailed CmdLet-Name

Do you have some feedback for us?

If you have suggestions for improving this article,