{"id":97,"date":"2020-03-27T20:04:04","date_gmt":"2020-03-27T19:04:04","guid":{"rendered":"http:\/\/sys-code-alpha.com\/?p=97"},"modified":"2022-11-15T13:59:09","modified_gmt":"2022-11-15T12:59:09","slug":"ps-remoting-diagonstics","status":"publish","type":"post","link":"https:\/\/sys-code-alpha.com\/?p=97","title":{"rendered":"PS Remoting diagnostics"},"content":{"rendered":"\n<p>One of the very common problems is to find the root cause why your Powershell Remoting is now working as expected.<\/p>\n\n\n\n<p>Below is a small tool that might shed some more light on this type of problem.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function Get-PSRemotingDiagnostics{\n                                    &lt;#\n                                    .SYNOPSIS\n                                    Presents WINRM diagnostic log data. \n                                    .DESCRIPTION\n                                    Presents WINRM diagnostic log data. \n                                    .example\n                                    PS C:\\&gt; Get-PSRemotingDiagnostics | Select-Object -First 10 | Format-Table\n\n                                    TimeCreated         OpcodeDisplayName TaskDisplayName          User            Message\n                                    -----------         ----------------- ---------------          ----            -------\n                                    24.10.2018 10:57:40 Info              Winrm service start\/stop NETWORK SERVICE The Winrm service started successfully\n                                    24.10.2018 10:57:40 Start             Winrm service start\/stop NETWORK SERVICE The Winrm service is starting\n                                    24.10.2018 10:56:03 Stop              Response handling        SYSTEM          WSMan operation Enumeration failed, error code 2150858770\n                                    24.10.2018 10:56:03 Info              User authentication      SYSTEM          The client cannot connect to the destination specified in the request. Verify that the\n                                    24.10.2018 10:56:03 Info                                       SYSTEM          Activity Transfer\n                                    24.10.2018 10:56:01 Start             WSMan API call           SYSTEM          WSMan operation Enumeration started with resourceUri http:\/\/schemas.microsoft.com\/wbem\/\n                                    23.10.2018 16:19:38 Stop              Response handling        Szymon          WSMan operation Identify failed, error code 2150858770\n                                    23.10.2018 16:19:38 Info              User authentication      Szymon          The client cannot connect to the destination specified in the request. Verify that the\n                                    23.10.2018 16:19:38 Info                                       Szymon          Activity Transfer\n                                    23.10.2018 16:19:36 Start             WSMan API call           Szymon          WSMan operation Identify started with resourceUri NotSpecified\n                                    #&gt;\n\n                                    Get-WinEvent -LogName \"*winrm*\" | Select-Object TimeCreated, OpcodeDisplayName, TaskDisplayName ,@{n='User';e={ (&#91;wmi]\"root\\cimv2:WIN32_SID.sid='$($_.userID)'\").AccountName }}, Message\n                                  }<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>One of the very common problems is to find the root cause why your Powershell Remoting is now working as expected. Below is a small tool that might shed some more light on this type of problem.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/sys-code-alpha.com\/index.php?rest_route=\/wp\/v2\/posts\/97"}],"collection":[{"href":"https:\/\/sys-code-alpha.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sys-code-alpha.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sys-code-alpha.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sys-code-alpha.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=97"}],"version-history":[{"count":2,"href":"https:\/\/sys-code-alpha.com\/index.php?rest_route=\/wp\/v2\/posts\/97\/revisions"}],"predecessor-version":[{"id":106,"href":"https:\/\/sys-code-alpha.com\/index.php?rest_route=\/wp\/v2\/posts\/97\/revisions\/106"}],"wp:attachment":[{"href":"https:\/\/sys-code-alpha.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=97"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sys-code-alpha.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=97"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sys-code-alpha.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=97"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}