Solved

Accessed Denied when Querying WMI

Posted on 2012-03-22
6
530 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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
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…

920 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

15 Experts available now in Live!

Get 1:1 Help Now