I will be frank with you, I do not know much about this error. What little that I do know is thanks to Mark P, Shane and Ramesh. Here is a wild guess, you are using WMI to connect to an object like DNS or Performance
Monitor.
The Symptoms you get
When you run the Windows Management Instrumentation Tester (WBEMTEST), connect to one of the Windows Management Instrumentation (WMI) namespaces (ROOT\CIMV2\xxxxxxxx), where xxxxxxx = perfmon or DNS.
The Cause of Code 80041001
It's probably no consolation that this is a poorly documented error. Again, thanks to Mark he said that it was intermittent, and the same script worked fine on another server. Makes me suspect
that Active Directory synchronisation is at the heart of this Code 80041001 problem.
The Solutions
Try running your VBScript on another machine? If this works, then your code is probably fine, it's more of a logical problem, or something up with the OS / Active Directory. I hate it when people say 'reboot the server', so try
simply restarting the services that you are investigating.
One possibility is that your winmgmts service is corrupted if so, you have the following options. To be honest, I believe that there is
only a 20% chance that these procedures will cure your 80041001 problem. A bonus is that you will learn or have a refresher on restarting services and registering services in the registry.
Start and Stop the winmgmts service
Navigate to the command prompt.
net stop winmgmt
Using Windows Explorer, navigate to %systemroot%\system32\wbem directory and
delete the Repository directory. By default, the repository folder is located in the C:\Windows\system32\wbem directory. Switch to Command Prompt window, and type: net start winmgmt
Re-Register
the DLLs
The .DLL and .EXE files which WMI uses are located in %windir%\system32\wbem. This is how you re-register all the .DLL and .EXE files in the WBEM directory. To re-register the WMI components, run
the following commands at the command prompt:
cd /d %windir%\system32\wbem for %i in (*.dll) do RegSvr32 -s %i for %i in (*.exe) do %i /RegServer
Re-Install WMI files
If you suspect
that the WMI files are damaged, then you could re-install them from the Windows Server 2003 or XP CD. Here is the nifty command:
Scenario: Script to create DNS entries. Kindly sent in by Martin Jeppesen
Problem: 'A' Host records already exist.
Solution: Delete the existing 'A' Host records.
Lesson for all of us, the script may be trying to create something that already exists. If so, one solution is to add: On Error Resume Next.
Guy Thomas recommends
Computer Training Software. Their topics and material are ideal for getting you started with VBScript. The
videos are easy to follow and you can control the pace. Try their free demo material and then see if you want to buy the full package.
See more about VB Script Training CD.
Do you have a good example of this error?
If so, then email me I will publish it with a credit to you: