I am trying to prepare a script to automate instance management to add and remove servers to SQLDM monitoring. I was able to add instance to SQLDB with "New-SQLdmMonitoredInstance", but the issue is with remove instance from SQLDM.I couldn't able to remove instances from SQLDB, getting following error,
Remove-SQLdmMonitoredInstance : Cannot find path 'dm:\Instances\10000-TEWADYX' because it does not exist.
The command I am using to remove instance is,
Remove-SQLdmMonitoredInstance -Path \Instances\10000-TEWADYX
Some help would be greatly appreciated.
Below is a screenshot example of me using the command. Notice that there is an error generated in my example as well. The error is because the SQLdmRepository database is case-sensitive and the names didn't match. Once I corrected the casing to match what's in the repository database, then the command worked as expected.
I know that the cmdlet has an option to use the -Path parameter to specify the name of the monitored instance. However, PATH doesn't work with named instances. As such, I typically always use the Escape-SQLdm method since it works with both named instances and default instances.
I hope that helps.
Thank you for your prompt response. I tried with Escape-SQLdm and still getting same error. In this case I don't have named instances and I using same case that I see on dashborad. BUt some reason I don't see this instance under "MonitoredSQLServers" DB table. I am new to Idera, and I am not sure how DB supposed to register it in DB
PS dm:\> Remove-SQLdmMonitoredInstance -Path (Escape-SQLdmName -Name 10000-TEWADY)Remove-SQLdmMonitoredInstance : Cannot find path 'dm:\Instances\10000-TEWADY' because it does not exist.At line:1 char:1
Powered by IDERA