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/folde
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)
Const ADS_SCOPE_SUBTREE = 2
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")
ElseIf colFolders.Count = 1 Then
'wscript.echo "Found C:\Windows"