I am trying to figure out how to determine which Windows Credential is tied to which node. I found some old docs with some SWSQL queries but they are not working and I keep running into dead ends. Thanks!
You would need to query the NodesSettings table to show which CredentialID is being used, and correlate that with the Credentials table. I’m not in front of my PC at the moment but will see if I can get a query together later if you still need it.
Full credit has to go to aLTeReGo for his Credentials Used By WMI Nodes report, and the SQL query from within it:
SELECT Credential.Name, nodes.Caption, nodes.NodeID,
nodesettings.SettingName, NodeSettings.SettingValue
FROM Nodes
JOIN NodeSettings
ON nodes.NodeID = Nodesettings.NodeID
JOIN Credential
ON nodesettings.SettingValue = Credential.ID
WHERE nodes.ObjectSubType = 'WMI'
AND nodesettings.SettingName = 'WMICredential'
ORDER BY Credential.Name, nodes.Caption, nodesettings.SettingValue
Check out aLTeReGo's report, as this is probably what you are after.
HIH
Oh this might be helpful to see the usernames from the credentials groups above:
/****** WMI Credentials - Group and usernames ******/
SELECT c.ID ,c.Name ,cp.Value
-- ,c.CredentialType ,c.CredentialOwner ,cp.Name
FROM Credential c
INNER JOIN CredentialProperty cp ON c.ID = cp.CredentialID
WHERE c.CredentialOwner LIKE 'Orion'
AND c.CredentialType LIKE 'SolarWinds.Orion.Core.SharedCredentials.Credentials.UsernamePasswordCredential'
AND cp.Name LIKE 'Username'
For those wanting to use SQWL or the API
Windows/WMISELECT C.Node.Fqdn, UserName, Password, OwnerFROM Cortex.Orion.WindowsCredential C
SNMP
SELECT N.NodeName, N.SNMPv3Credentials.Username, N.CommunityFROM orion.nodes NWHERE N.ObjectSubType != 'wmi'
FQDN is not all that helpful so I pulled in the NodeName:
SELECT N.NodeName, C.Node.Fqdn, UserName, Password, OwnerFROM Cortex.Orion.WindowsCredential CJoin Orion.Nodes N on C.nODE.NodeId = N.NodeID