Removing a Personalization Server or Management Server database connection from the SCP using Powershell

Version 5

    Verified Product Versions

    AppSense Management Center 10.0AppSense Management Center 10.1

    Introduction

     

    If you cannot remove a database connection (EM Personalization Server or Management Server) from the SCP you may need to use a Powershell command to achieve it. The way to do this is detailed below.

    This method can also be used as part of a script or as a quicker way to remove a connection.

     

    Detail

    Firstly, ensure that the database connection is not in use by the server instance. If it is, you can change it in the SCP.
    Run Powershell as an administrator, then use the following commands. You need to ensure you use the correct command to delete either a Personalization or Management Center database connection. If you need to remove a Personalization Server connection as well as a Management Server connection, you will need to close and re-open Powershell after removing the first one because the Import-ApsInstanceModule cmdlet imports the module which is valid for the entire session and cannot be changed to a different product.

     

    NOTE: In the examples below the name of the connection is within the quotation marks, you will need to substitute your own name here (this is not the database name but the connection name)

     

    Remove a Personalization Server database connection

    Import-ApsInstanceModule -ProductName "Personalization Server" -IsDefault

    Import-Module 'C:\Program Files\AppSense\Server Configuration Portal\Bin\AppSense.ServerConfigurationPortal.PowerShell.dll'

    Get-Command -Module AppSense.ServerConfigurationPortal.PowerShell

     

    Get-ApsDatabaseDetail

      Make a note of the Connection name returned by the Get-ApsDatabaseDetail command above, then:

    Remove-ApsDatabaseConnection "<connectionname>" Personalization

     

    Remove Management Center database connection:

    Import-ApsInstanceModule -ProductName "Management Server" -IsDefault

    Import-Module 'C:\Program Files\AppSense\Server Configuration Portal\Bin\AppSense.ServerConfigurationPortal.PowerShell.dll'

    Get-Command -Module AppSense.ServerConfigurationPortal.PowerShell

     

    Get-ApsDatabaseDetail

      Make a note of the Connection name returned by the Get-ApsDatabaseDetail command above, then:

    Remove-ApsDatabaseConnection "<connectionname>" Management

     

    NOTE: If the above method fails to remove the connection you may need to reset the server to factory defaults. See the following article for instructions: How to Reset the Server Configuration Portal to an out of box state