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
I have been trying to execute these add and remove instance command from remote server. When executed Add instance cmdlet, it worked and I see the instance on dashboard and DB, so it tells me it successfully connecting SQLdm. whereas executing remove instance command, it is not working and not listing instances.
So I have tried the same remove cmd directly on server where Idera is running, it listed the instances and also was able to remove the server. It tells me remove instance cmd is not working from remote server.
Do you know what blocking remove cmd from remote server or this is how Idera works?
I went and tested using the snapin from a remote server and I was able to use it successfully.
My best guess at this point is that perhaps application security in SQLDM (if enable) might be doing something odd in your environment. If you can add, you should be able to remove. If you can't add, then you also shouldn't able to remove.
Out of curiosity, are you logged into windows under the same user account on both the remote server and the SQLDM server? Does the Get-ChildItem show you the same results on both?It might be a good idea to open a support case to dig into this further as it seems like there might be something in your environment that's causing these oddities.
Yes, I am using same windows account on both the servers. For Get-ChilItem, Instances is blank on remote server, whereas on DQLDM it printed the instances. Problem is only from remote server.
I will check on security options. But I was able add instance from remote server.
As you mentioned earlier, the issue seems with the SQLDM desktop client version that I installed on remote server. The SQLDM version running is 10.0.2. Unfortunately we no longer have client file "SQLDiagnosticManager-x64_c.exe" with same version in Installation kit. Due to this, Client even not able to connect to SQLDM and throwing following error. Not sure why add command worked but not remove command.
Do you know where can I find Client installer v10.0? or way to downgrade?
Thank you for your help all along.
unfortunately, I do not know where you could find an older version of the installer. If you have current maintenance with IDERA, you can check with them to see if they can provide it to you. However, given that it appears to be out of support, I'm not sure that they would be able to provide it to you.
Powered by IDERA