Jane Lewis's Weblog

Platforms, Active Directory,Administration, Management,Women in Technology, Random Thoughts

Powershell script to help check WMI setting has been configured

Powershell script to help check WMI setting has been configured

  • Comments 2
  • Likes

We all know how powerful Powershell is, so it is great to highlight an example of where it was showed to be very effective and really quick to create a positive result.

Recently I highlighted and issue that affected 2003 Domain Controllers which caused High CPU on WMIprvse.exe caused by a memory leak dnsprov.dll.

http://blogs.technet.com/janelewis/archive/2009/12/18/high-cpu-on-wmiprvse-exe-caused-by-memory-leak-dnsprov-dll-windows-2003.aspx

Well with my customer I work with we implemented the change across the entire estate and wanted to check and verify whether this change had been implemented successfully.

Well one of the guys I was working with had recently attended a Premier workshop on Powershell and was eager to try out powershell instead of the vbscript that I had put together.

The powershell script is as below; This checked all the domain controllers to verify that the DNSPROV.DLL is now running within its own isolated wmiprvse.

Powershell line to check DNS shared provider on DCs (note WMI query requires admin rights)

$DCs = [ADSI] $DCs ='LDAP://OU=Domain Controllers,DC=ABC,DC=DEF=Local'; $wmi = foreach($DC in $DCs.psbase.get_children()) {gwmi -namespace Root\MicrosoftDNS -class __Win32Provider -computer $DC.Name}; $wmi | ft __SERVER,HostingModel –au

So if you are applying the workaround mentioned in my previous blog. Please use this powershell script to checkout it has applied across your environment. It certainly worked a treat in our case. Plus also my customer colleague was pleased as punch that he could immediately apply his knowledge from the course. He now has bragging rights as the resident Powershell guru :).

Comments
  • I have found very useful information over there on Powershell script, thanks for sharing this. http://21stcenturymediarelations.com

  • This is a smart blog. I mean it. You have so much knowledge about this issue, and so much passion. You also know how to make people rally behind it, obviously from the responses. the venus factor diet

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment