{"id":289,"date":"2022-02-01T04:17:33","date_gmt":"2022-02-01T04:17:33","guid":{"rendered":"https:\/\/ouritsource.com\/blog\/?p=289"},"modified":"2022-02-01T04:17:33","modified_gmt":"2022-02-01T04:17:33","slug":"get-wmiobject-to-remote-computer-returning-access-denied","status":"publish","type":"post","link":"https:\/\/ouritsource.com\/blog\/get-wmiobject-to-remote-computer-returning-access-denied\/","title":{"rendered":"Get-WmiObject to Remote Computer Returning Access Denied"},"content":{"rendered":"<body>\n<p>On servers, WinRM remoting is enabled by default but not on client windows pcs. To manually enable WinRM remoting, run the following command with Administrator privileges (Right-click powershell and select, \u201cRun as Administrator\u201d. <\/p>\n\n\n\n<p class=\"has-vivid-cyan-blue-color has-text-color\">Enable-PSRemoting -SkipNetworkProfileCheck -Force<\/p>\n\n\n\n<p>Reference: https:\/\/powershell.one\/wmi\/remote-access<\/p>\n\n\n\n<p><strong>Other suggestions:<\/strong><\/p>\n\n\n\n<p>Add Firewall exception on the target pc: <\/p>\n\n\n\n<p class=\"has-vivid-cyan-blue-color has-text-color\">netsh firewall set service remoteadmin enable<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Powershell Scripts to get Remote Discovery information used by ServiceNow Discovery<\/strong><\/p>\n\n\n\n<p class=\"has-vivid-cyan-blue-color has-text-color\">Get-WmiObject -Class Win32_ComputerSystem -computername \u2018pts-cybpro01\u2019 -Credential \u2018pts-cybpro01\\mid-discovery\u2019<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"640\" height=\"134\" src=\"https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2022\/02\/image-5.png?resize=640%2C134&#038;ssl=1\" alt=\"\" class=\"wp-image-297\" loading=\"lazy\" srcset=\"https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2022\/02\/image-5.png?w=1021&amp;ssl=1 1021w, https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2022\/02\/image-5.png?resize=300%2C63&amp;ssl=1 300w, https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2022\/02\/image-5.png?resize=768%2C160&amp;ssl=1 768w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p>Powershell Scripts to test wmi:<\/p>\n\n\n\n<p><strong>get_remote_bios.ps1<\/strong><br>$computer = \u2018pts-cybpro01\u2019<br>$credential = Get-Credential<br><br>Get-WmiObject -Class Win32_BIOS -ComputerName $computer -Credential $credential<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"556\" height=\"238\" src=\"https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2022\/02\/image-3.png?resize=556%2C238&#038;ssl=1\" alt=\"\" class=\"wp-image-295\" loading=\"lazy\" srcset=\"https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2022\/02\/image-3.png?w=556&amp;ssl=1 556w, https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2022\/02\/image-3.png?resize=300%2C128&amp;ssl=1 300w\" sizes=\"auto, (max-width: 556px) 100vw, 556px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"342\" height=\"296\" src=\"https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2022\/02\/image-1.png?resize=342%2C296&#038;ssl=1\" alt=\"\" class=\"wp-image-293\" loading=\"lazy\" srcset=\"https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2022\/02\/image-1.png?w=342&amp;ssl=1 342w, https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2022\/02\/image-1.png?resize=300%2C260&amp;ssl=1 300w\" sizes=\"auto, (max-width: 342px) 100vw, 342px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"383\" height=\"115\" src=\"https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2022\/02\/image-2.png?resize=383%2C115&#038;ssl=1\" alt=\"\" class=\"wp-image-294\" loading=\"lazy\" srcset=\"https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2022\/02\/image-2.png?w=383&amp;ssl=1 383w, https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2022\/02\/image-2.png?resize=300%2C90&amp;ssl=1 300w\" sizes=\"auto, (max-width: 383px) 100vw, 383px\" \/><\/figure>\n\n\n\n<p>Powershell Script to test that WMI is running on target pc:<\/p>\n\n\n\n<p><strong>verify_wmi.ps1<\/strong><\/p>\n\n\n\n<p>$computer = \u2018pts-cybpro1\u2019<br>Test-WSMan -ComputerName $computer<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"619\" height=\"157\" src=\"https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2022\/02\/image-4.png?resize=619%2C157&#038;ssl=1\" alt=\"\" class=\"wp-image-296\" loading=\"lazy\" srcset=\"https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2022\/02\/image-4.png?w=619&amp;ssl=1 619w, https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2022\/02\/image-4.png?resize=300%2C76&amp;ssl=1 300w\" sizes=\"auto, (max-width: 619px) 100vw, 619px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n<\/body>","protected":false},"excerpt":{"rendered":"<p>On servers, WinRM remoting is enabled by default but not on client windows pcs. To manually enable WinRM remoting, run the following command with Administrator privileges (Right-click powershell and select, \u201cRun as&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-289","post","type-post","status-publish","format-standard","hentry","category-miscellaneous","no-thumbnail"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/posts\/289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/comments?post=289"}],"version-history":[{"count":2,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/posts\/289\/revisions"}],"predecessor-version":[{"id":298,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/posts\/289\/revisions\/298"}],"wp:attachment":[{"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/media?parent=289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/categories?post=289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/tags?post=289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}