troubleshooting Question

WMI Error on GetObject line, Error 70

Avatar of sunnyd24
sunnyd24 asked on
Windows Server 2003VB Script
8 Comments2 Solutions3159 ViewsLast Modified:
If there was an impossible level I would definitely set this question to that difficulty.  

WMI isn't working correctly on all of my servers(about 200).  They are all returning an error 70 for the script:

I have ran the WMI diagnostics script from MS and it did not come back with any errors.  I can connect to \root\Wmi just fine.

We have been making mass GPO changes, but I have combed through and not seen anything that could remotely affect WMI, but I am at a loss to where to go now to continue troubleshooting.  I have checked the permissions on the box/files/namespaces/folders, etc...

Any clues on how to find what is causing this?
On Error Resume Next
Set oFSO2 = CreateObject("Scripting.FileSystemObject")
Set oFile2 = oFSO2.CreateTextFile(OutputFile2, True)
Set oFSO3 = CreateObject("Scripting.FileSystemObject")
Set oFile3 = oFSO3.CreateTextFile(OutputFile3, True)
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand =   CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE 
objCommand.CommandText = _
    "SELECT ADsPath FROM 'LDAP://ou=Blah,dc=Stuff,dc=Com' WHERE " & _
Set objRecordSet = objCommand.Execute
Do Until objRecordSet.EOF
    Set objComputer = GetObject(objRecordSet.Fields("ADsPath").Value)
Set objWMIService = GetObject("winmgmts:\\" & objComputer.CN & "\root\cimv2")
If Err.Number <> 0 Then
Set colFolders = objWMIService. _
    ExecQuery("Select * From Win32_Directory where Name = 'C:\\Windows'")
If colFolders.Count = 0 Then
			oFile3.WriteLine(objComputer.CN & " 0 folders Found")
'wscript.echo "Bullshit"
ElseIf colFolders.Count = 1 Then
'wscript.echo "Found C:\Windows"
End If 
End If
msgbox "Done"
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros