I am receiving the error message "Could not complete operation due to error 80041003" when trying to run my script to another domain. The 80041003 message is the same as access denied, but I do have access. The code stops on line 70. I have the number 70 next to it. Any help would be greatly appreciated.
If strComputerName = "" Then
Set wmiRoot = GetObject("WinMgmts:root/cimv2")
Set wmiColl = wmiRoot.ExecQuery("Select * FROM Win32_ComputerSystem")
For Each wmiObj In wmiColl
strComputerName = wmiObj.Name
Next
Else
70 Set wmiRoot = GetObject("WinMgmts://"&strComputerName&"/root/cimv2")
End If
If strComputerName = "" Then
Set wmiRoot = GetObject("WinMgmts:root/cimv2")
Set wmiColl = wmiRoot.ExecQuery("Select * FROM Win32_ComputerSystem")
For Each wmiObj In wmiColl
strComputerName = wmiObj.Name
Next
Else
70 Set wmiRoot = GetObject("WinMgmts://"&strComputerName&"/root/cimv2")
End If