{"id":7171,"date":"2007-10-29T20:01:00","date_gmt":"2007-10-29T20:01:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/powershell\/2007\/10\/29\/winrm\/"},"modified":"2019-02-18T13:16:29","modified_gmt":"2019-02-18T20:16:29","slug":"winrm","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/winrm\/","title":{"rendered":"WINRM"},"content":{"rendered":"<p>WINRM is the CLI interface to our WS-MGMT protocol. The neat thing about this is that you can call it from PowerShell to manage remote systems that don&#8217;t have PowerShell installed on them (including Server Core systems and Raw hardware). I was trying some things out and encountered the following error: <\/p>\n<p><span>PS&gt; winrm<br \/>C:\\Windows\\System32\\winrm.vbs(1034, 1) Microsoft VBScript runtime error: ActiveX component can&#8217;t create object: &#8216;WSMAN.InternalAutomation&#8217; <\/span><\/p>\n<p>This is the second time that I&#8217;ve done something that made this problem come up. I&#8217;m working on a system that changes constantly so it is probably some side effect of something you&#8217;ll never encounter. That said, I&#8217;ve run into it twice so I thought I would share the fix. This also documents the fix so if it happens to me again, I&#8217;ll just use LiveSearch to find the solution <span>J<\/span>. <\/p>\n<p>Run a PowerShell session with Admin Privs (I&#8217;m doing this on Vista): <\/p>\n<p><span>PS&gt; cd ${env:windir}\/system32<br \/>PS&gt; Regsvr32 WsmAuto.dll<br \/>PS&gt; Regsvr32 WSManMigrationPlugin.dll<br \/><\/span><\/p>\n<p>Do that and <a href=\"http:\/\/www.worldwidewords.org\/qa\/qa-bob1.htm\">Bob&#8217;s your Uncle<\/a>. <\/p>\n<p>BTW &#8211; you can do cool stuff with WINRM from PowerShell if you remember 2 things: <\/p>\n<ol>\n<li>You have to quote native code command switches that use &#8220;:&#8221;s <\/li>\n<li>\n<div>You can cast XML to [XML] and then party <\/div>\n<\/li>\n<\/ol>\n<p><span><span>PS&gt;<\/span> <span><strong>winrm e wmi\/root\/cimv2\/win32_service<\/strong><\/span><span><strong><br \/><\/strong>Win32_Service<br \/>AcceptPause = false<br \/>AcceptStop = true<br \/>Caption = Application Experience<br \/>CheckPoint = 0<br \/>CreationClassName = Win32_Service<br \/>Description = Processes application compatibility cache requests for applications as<br \/>they are launched<br \/>DesktopInteract = false<br \/>DisplayName = Application Experience<br \/>ErrorControl = Normal<br \/>ExitCode = 0<br \/>InstallDate = null<br \/>Name = AeLookupSvc<br \/>PathName = C:\\Windows\\system32\\svchost.exe -k netsvcs<br \/>ProcessId = 1108<br \/>ServiceSpecificExitCode = 0<br \/>ServiceType = Share Process<br \/>Started = true<br \/>StartMode = Auto<br \/>StartName = localSystem<br \/>State = Running<br \/>Status = OK<br \/>SystemCreationClassName = Win32_ComputerSystem<br \/>SystemName = JPSLAP11<br \/>TagId = 0<br \/>WaitHint = 0<br \/><span><strong><em>&lt;TOO MUCH STUFF&gt;<\/em><\/strong><\/span><br \/>PS&gt; <\/span><span><span><strong># Apparently the WINRM folks think XML is &#8220;Pretty&#8221;<\/strong><\/span><span><br \/><\/span><\/span><span>PS&gt; <\/span><span><strong><em>winrm e wmi\/root\/cimv2\/win32_service &#8220;-format:pretty&#8221;<\/em><\/strong><\/span><span><br \/>&lt;wsman:Results xmlns:wsman=&#8221;http:\/\/schemas.dmtf.org\/wbem\/wsman\/1\/wsman\/results&#8221;&gt;<br \/>&lt;p:Win32_Service xsi:type=&#8221;p:Win32_Service_Type&#8221; xmlns:xsi=&#8221;http:\/\/www.w3.org\/2001\/XMLSch<br \/>ema-instance&#8221; xmlns:p=&#8221;http:\/\/schemas.microsoft.com\/wbem\/wsman\/1\/wmi\/root\/cimv2\/Win32_Ser<br \/>vice&#8221; xmlns:cim=&#8221;http:\/\/schemas.dmtf.org\/wbem\/wscim\/1\/common&#8221;&gt;<br \/>&lt;p:AcceptPause&gt;false&lt;\/p:AcceptPause&gt;<br \/>&lt;p:AcceptStop&gt;true&lt;\/p:AcceptStop&gt;<br \/>&lt;p:Caption&gt;Application Experience&lt;\/p:Caption&gt;<br \/>&lt;p:CheckPoint&gt;0&lt;\/p:CheckPoint&gt;<br \/>&lt;p:CreationClassName&gt;Win32_Service&lt;\/p:CreationClassName&gt;<br \/>&lt;p:Description&gt;Processes application compatibility cache requests for applications as<br \/>they are launched&lt;\/p:Description&gt;<br \/>&lt;p:DesktopInteract&gt;false&lt;\/p:DesktopInteract&gt;<br \/>&lt;p:DisplayName&gt;Application Experience&lt;\/p:DisplayName&gt;<br \/>&lt;p:ErrorControl&gt;Normal&lt;\/p:ErrorControl&gt;<br \/>&lt;p:ExitCode&gt;0&lt;\/p:ExitCode&gt;<br \/>&lt;p:InstallDate xsi:nil=&#8221;true&#8221;&gt;&lt;\/p:InstallDate&gt;<br \/>&lt;p:Name&gt;AeLookupSvc&lt;\/p:Name&gt;<br \/>&lt;p:PathName&gt;C:\\Windows\\system32\\svchost.exe -k netsvcs&lt;\/p:PathName&gt;<br \/>&lt;p:ProcessId&gt;1108&lt;\/p:ProcessId&gt;<br \/>&lt;p:ServiceSpecificExitCode&gt;0&lt;\/p:ServiceSpecificExitCode&gt;<br \/><span><strong><em>&lt;MORE AND MORE&gt;<\/em><\/strong><\/span><br \/>PS&gt; <\/span><span><strong>$x=[xml](winrm e wmi\/root\/cimv2\/win32_service &#8220;-format:pretty&#8221;)<\/strong><\/span><span><br \/>PS&gt; <\/span><span><strong>$x<\/strong><\/span><span><\/p>\n<p>Results<br \/>&#8212;&#8212;-<br \/>Results<\/p>\n<p>PS&gt; <\/span><span><strong>$x.results<br \/><\/strong><\/span><span><br \/>wsman Win32_Service<br \/>&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;-<br \/>http:\/\/schemas.dmtf.org\/wbem\/wsman&#8230; {AeLookupSvc, ALG, Appinfo, AppMgm&#8230;<\/p>\n<p>PS&gt; <\/span><span><strong>$x.results.Win32_service |sort State,Name |ft -group State name,Caption<br \/>-auto<\/strong><\/span><span><\/p>\n<p>State: Running<\/p>\n<p>Name Caption<br \/>&#8212;- &#8212;&#8212;-<br \/>AeLookupSvc Application Experience<br \/>Appinfo Application Information<br \/>AppMgmt Application Management<br \/>ASFIPmon Broadcom ASF IP and SMBIOS Mailbox Monitor<br \/><span><em>&lt;MORE AND MORE&gt;<\/em><\/span><\/p>\n<p>State: Stopped<\/p>\n<p>Name Caption<br \/>&#8212;- &#8212;&#8212;-<br \/>ALG Application Layer Gateway Service<br \/>aspnet_state ASP.NET State Service<br \/>clr_optimization_v2.0.50727_32 Microsoft .NET Framework NGEN v2.0&#8230;<br \/><span><em>&lt;MORE AND MORE&gt;<\/em><\/span><\/p>\n<p>PS&gt;<br \/><\/span><\/span><\/p>\n<p>Cheers! <\/p>\n<p>Jeffrey Snover [MSFT]<br \/>Windows Management Partner Architect<br \/>Visit the Windows PowerShell Team blog at: <a href=\"http:\/\/blogs.msdn.com\/PowerShell\">http:\/\/blogs.msdn.com\/PowerShell<\/a><br \/>Visit the Windows PowerShell ScriptCenter at: <a href=\"http:\/\/www.microsoft.com\/technet\/scriptcenter\/hubs\/msh.mspx\">http:\/\/www.microsoft.com\/technet\/scriptcenter\/hubs\/msh.mspx<\/a> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>WINRM is the CLI interface to our WS-MGMT protocol. The neat thing about this is that you can call it from PowerShell to manage remote systems that don&#8217;t have PowerShell installed on them (including Server Core systems and Raw hardware). I was trying some things out and encountered the following error: PS&gt; winrmC:\\Windows\\System32\\winrm.vbs(1034, 1) Microsoft [&hellip;]<\/p>\n","protected":false},"author":600,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7171","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"acf":[],"blog_post_summary":"<p>WINRM is the CLI interface to our WS-MGMT protocol. The neat thing about this is that you can call it from PowerShell to manage remote systems that don&#8217;t have PowerShell installed on them (including Server Core systems and Raw hardware). I was trying some things out and encountered the following error: PS&gt; winrmC:\\Windows\\System32\\winrm.vbs(1034, 1) Microsoft [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/7171","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/600"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=7171"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/7171\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=7171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=7171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=7171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}