{"id":12660,"date":"2016-09-07T06:00:09","date_gmt":"2016-09-07T13:00:09","guid":{"rendered":"https:\/\/www.sapien.com\/blog\/?p=12660"},"modified":"2016-09-07T09:18:08","modified_gmt":"2016-09-07T16:18:08","slug":"enable-wmi-explorer-remote-connection-permissions","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2016\/09\/07\/enable-wmi-explorer-remote-connection-permissions\/","title":{"rendered":"Enable WMI Explorer Remote Connection Permissions"},"content":{"rendered":"<p>One of my first tasks, after I was hired at SAPIEN, was to figure out why users couldn\u2019t view WMI classes on remote computers and turn the solution into an easy-to-follow <a href=\"https:\/\/www.sapien.com\/blog\/2015\/10\/07\/wmi-explorer-windows-8-remote-connection-issues\/\">blog post<\/a>. After completing that, I had to turn it into <a href=\"https:\/\/www.sapien.com\/blog\/2015\/12\/14\/enable-wmi-explorer-windows-8-remote-connection-permissions\/\">a script<\/a> so that it was even easier to set up. Although I managed to complete the script, there was the catch that it worked only on Windows 8. I couldn\u2019t figure out why it wasn\u2019t working on Windows 10. With the help of a couple of SAPIEN MVPs (thanks, <a href=\"https:\/\/www.sapien.com\/company\/mvp\/10\/Mike_Robbins\">Mike<\/a> and <a href=\"https:\/\/www.sapien.com\/company\/mvp\/12\/James_Vierra\">James<\/a>!), I\u2019m happy to share that I have a script that works on Windows 7, 8, and 10.<\/p>\n<p>To use the script, you can download it here: <a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2016\/08\/Set-WMIExplorerPermissions_FINAL-83116.zip\">Set-WMIExplorerPermissions<\/a>. Or you can also get it from within WMI Explorer in the ribbon. Click the Tools tab and use one of the new Open\/Copy Script buttons. Open Script launches the script in your default program of choice whereas Copy Script will export it to the place of your choice:<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2016\/09\/Permission_Script.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-12673\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2016\/09\/Permission_Script.png\" alt=\"Permission_Script\" width=\"600\" height=\"145\" srcset=\"https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2016\/09\/Permission_Script.png 600w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2016\/09\/Permission_Script-300x73.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Run the script locally, in an elevated session (Run as Administrator), on the machine that you want to access. This script is not designed to be run remotely, for example, by using <a href=\"https:\/\/technet.microsoft.com\/en-us\/library\/hh849719.aspx\">Invoke-Command<\/a>. Because it grants permission to the current user, be sure that the script runs in the user account of the person running <a href=\"https:\/\/www.sapien.com\/software\/wmiexplorer\">WMI Explorer<\/a>.<\/p>\n<p>It requires PowerShell 3.0+ and in order to follow the progress of the script, use its Verbose parameter.<\/p>\n<h2>Windows 8 v. Windows 10<\/h2>\n<p>I couldn\u2019t get the previous script to run on Windows 10 because you have to enable Windows Management Instrumentation (WMI) in the firewall. On Windows 8, you only have to enable Windows Remote Management (WRM). To solve the firewall problem, if you have the NetSecurity module and the WMI\/WRM rule groups, I use the <a href=\"https:\/\/technet.microsoft.com\/en-us\/library\/jj573828(v=wps.630).aspx\">Set-NetFirewallRule<\/a> cmdlet . Otherwise, I use netsh to create the rule groups and set the permissions. If the user doesn\u2019t have permission to modify the results, an exception is thrown.<\/p>\n<h2>Error Checking<\/h2>\n<p>The last major change was to prevent errors and properly handle any errors that might have been missed. For example, in the original script, I added the current user to the DCOM Users Group, but never actually checked to see if the user was in the group. Now, it checks to see if the current user is in the DCOM Users Group and, if so, it\u2019ll skip over this step; otherwise it adds them.<\/p>\n<p>Also, instead of continuing in the background if an error was encountered, I throw terminating errors so that the user knows where it went wrong and we can fix it for a future release.<\/p>\n<p><em>Devin Leaman is the Jr. Software Test Engineer at SAPIEN Technologies, Inc. You can find him on the SAPIEN forums and follow him on Twitter at @SAPIENTech and @dleaman212.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of my first tasks, after I was hired at SAPIEN, was to figure out why users couldn\u2019t view WMI classes on remote computers and turn the solution into an easy-to-follow blog post. After completing that, I had to turn it into a script so that it was even easier to set up. Although I [&hellip;]<\/p>\n","protected":false},"author":43,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[283,1143,1055,833],"tags":[28,35,1020],"class_list":["post-12660","post","type-post","status-publish","format-standard","hentry","category-howto","category-powershell","category-scripting","category-wmi-explorer","tag-powershell","tag-wmi","tag-wmi-explorer"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/12660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/users\/43"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/comments?post=12660"}],"version-history":[{"count":9,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/12660\/revisions"}],"predecessor-version":[{"id":12687,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/12660\/revisions\/12687"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=12660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=12660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=12660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}