?
Solved

Accessed Denied when Querying WMI

Posted on 2012-03-22
6
Medium Priority
?
553 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
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…
Suggested Courses

752 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