Solved

Accessed Denied when Querying WMI

Posted on 2012-03-22
6
537 Views
Last Modified: 2012-03-31
I have several machines that I get Access Denied on when querying through WMI. If WMI is corrupted the below batch usually fixes it, but not in this case.  Any best practice steps on resolving this? All accounts used to query are domain admin.

Echo Rebuilding WMI.....Please wait. > c:\wmirebuild.log
net stop sharedaccess >> c:\wmirebuild.log
net stop winmgmt /y >> c:\wmirebuild.log
cd C:\WINDOWS\system32\wbem >> c:\wmirebuild.log
del /Q Repository >> c:\wmirebuild.log
c:
cd c:\windows\system32\wbem >> c:\wmirebuild.log
rd /S /Q repository >> c:\wmirebuild.log
regsvr32 /s %systemroot%\system32\scecli.dll >> c:\wmirebuild.log
regsvr32 /s %systemroot%\system32\userenv.dll >> c:\wmirebuild.log
mofcomp cimwin32.mof >> c:\wmirebuild.log
mofcomp cimwin32.mfl >> c:\wmirebuild.log
mofcomp rsop.mof >> c:\wmirebuild.log
mofcomp rsop.mfl >> c:\wmirebuild.log
for /f %%s in ('dir /b /s *.dll') do regsvr32 /s %%s >> c:\wmirebuild.log
for /f %%s in ('dir /b *.mof') do mofcomp %%s >> c:\wmirebuild.log
for /f %%s in ('dir /b *.mfl') do mofcomp %%s >> c:\wmirebuild.log
mofcomp exwmi.mof >> c:\wmirebuild.log
mofcomp -n:root\cimv2\applications\exchange wbemcons.mof >> c:\wmirebuild.log
mofcomp -n:root\cimv2\applications\exchange smtpcons.mof >> c:\wmirebuild.log
mofcomp exmgmt.mof >> c:\wmirebuild.log
net stop winmgmt >> c:\wmirebuild.log
net start winmgmt >> c:\wmirebuild.log
gpupdate /force >> c:\wmirebuild.log

Open in new window

0
Comment
Question by:DarthRater
  • 3
  • 3
6 Comments
 
LVL 6

Expert Comment

by:netjgrnaut
ID: 37752582
I see the script runs locally - right?

So... do you get an error when running the script?  Or just an error when querying WMI?

If the later, when querying from remote or local or both?
0
 

Author Comment

by:DarthRater
ID: 37756510
Yes it runs locally. No error when running the script. I get the error when remotely checking wmi.
0
 
LVL 6

Expert Comment

by:netjgrnaut
ID: 37756534
Can you query WMI locally on the affected computers?  Perhaps you only need to enable remote connections to WMI on those systems...

What version of Windows are the problem hosts running?  If it's post-XP, review the steps in this TechNet article to verify that remote management is enabled on the systems:

http://msdn.microsoft.com/en-us/library/aa822854.aspx
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Accepted Solution

by:
DarthRater earned 0 total points
ID: 37766765
It turns out I had to re-join the machine to the domain. Thanks for the attempt though. :)
0
 
LVL 6

Expert Comment

by:netjgrnaut
ID: 37766783
Huh.  Live and learn.  Thanks for the follow-up!
0
 

Author Closing Comment

by:DarthRater
ID: 37790320
Self Resolved
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Screen Mirroring 7 66
Domain Share problems 5 53
2003 Server DNS/FS errors 6 49
Move windows 10 users 8 49
If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now