Correct me if I'm wrong, but this looks like the script is trying to query WMI using a wrong server name (server.company.corp.subdomain.company.corp), right? So obviously it can't open it.
I think I've already faced this problem.
If I remember correctly, it is related to the method the script uses to find the server's fqdn :
First it uses the FQDN discovered by the SCOM Agent (server.company.corp)


Then it does an LDAP query on GC://RootDSE to find the defaultNamingContext

Then it compares both values, and if the defaultNamingContext is not contained in the FQDN, it considers that the FQDN is wrong and append it to the defaultNamingContext.

So, what happens is that the SCOM agent says "FQDN for this server is server.domain.com", but the LDAP request says "defaultNamingContext is xxx.company.corp".
Since xxx.company.corp is not contained in server.company.corp, the script "rebuilds" what it thinks would be the correct FQDN : server.company.corp.xxx.company.corp.
This happens when for some reason, the LDAP query to GC://RootDSE is targeted at a GC that is not in the same domain as the SQL server.
The thing is, I never had time to go further and work with a qualified AD/DNS admin on this, so I don't really know how a server chooses what GC it will target for a GC:// query and therefore I don't have a solution for this issue.
Hope these explanations helped, though!
-
Edited by
CyrAz
Sunday, December 28, 2014 2:31 PM