Solved

Accessed Denied when Querying WMI

Posted on 2012-03-22
6
524 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Accepted Solution

by:
DarthRater earned 0 total points
Comment Utility
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
Comment Utility
Huh.  Live and learn.  Thanks for the follow-up!
0
 

Author Closing Comment

by:DarthRater
Comment Utility
Self Resolved
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

We have adopted the strategy to use Computers in Student Labs as the bulletin boards. The same target can be achieved by using a Login Notice feature in Group policy but it’s not as attractive as graphical wallpapers with message which grabs the att…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
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…

772 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

12 Experts available now in Live!

Get 1:1 Help Now