syspolicy_purge_history and non-default port

  • If you have a server with a non-default port number, do you need to add it into the following powershell command?

    Get-Item SQLSERVER:\SQLPolicy\SERVERNAME\DEFAULT).EraseSystemHealthPhantomRecords()

  • A little more info. This used to be a stand alone server and the job would work even with a non default port number. We then moved it into a clustered environment. Like other servers we have in a cluster, we changed the name in the command to the virtual server name. However, this did not fix the problem. The only difference with this server is that it is not using the default port of 1433.

  • Just in case anyone else is having this issue, this is what I did to solve it. The command needed a tick mark (`) to escape a special character. In this case, it is a comma.

    Get-Item SQLSERVER:\SQLPolicy\SERVERNAME`,1234\DEFAULT).EraseSystemHealthPhantomRecords()

  • Thank you

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply