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'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> winrmC:\Windows\System32\winrm.vbs(1034, 1) Microsoft VBScript runtime error: ActiveX component can't create object: 'WSMAN.InternalAutomation'
This is the second time that I've done something that made this problem come up. I'm working on a system that changes constantly so it is probably some side effect of something you'll never encounter. That said, I'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'll just use LiveSearch to find the solution J.
Run a PowerShell session with Admin Privs (I'm doing this on Vista):
PS> cd ${env:windir}/system32PS> Regsvr32 WsmAuto.dllPS> Regsvr32 WSManMigrationPlugin.dll
Do that and Bob's your Uncle.
BTW - you can do cool stuff with WINRM from PowerShell if you remember 2 things:
PS> winrm e wmi/root/cimv2/win32_serviceWin32_ServiceAcceptPause = falseAcceptStop = trueCaption = Application ExperienceCheckPoint = 0CreationClassName = Win32_ServiceDescription = Processes application compatibility cache requests for applications asthey are launchedDesktopInteract = falseDisplayName = Application ExperienceErrorControl = NormalExitCode = 0InstallDate = nullName = AeLookupSvcPathName = C:\Windows\system32\svchost.exe -k netsvcsProcessId = 1108ServiceSpecificExitCode = 0ServiceType = Share ProcessStarted = trueStartMode = AutoStartName = localSystemState = RunningStatus = OKSystemCreationClassName = Win32_ComputerSystemSystemName = JPSLAP11TagId = 0WaitHint = 0<TOO MUCH STUFF>PS> # Apparently the WINRM folks think XML is "Pretty"PS> winrm e wmi/root/cimv2/win32_service "-format:pretty"<wsman:Results xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman/results"><p:Win32_Service xsi:type="p:Win32_Service_Type" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service" xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common"><p:AcceptPause>false</p:AcceptPause><p:AcceptStop>true</p:AcceptStop><p:Caption>Application Experience</p:Caption><p:CheckPoint>0</p:CheckPoint><p:CreationClassName>Win32_Service</p:CreationClassName><p:Description>Processes application compatibility cache requests for applications asthey are launched</p:Description><p:DesktopInteract>false</p:DesktopInteract><p:DisplayName>Application Experience</p:DisplayName><p:ErrorControl>Normal</p:ErrorControl><p:ExitCode>0</p:ExitCode><p:InstallDate xsi:nil="true"></p:InstallDate><p:Name>AeLookupSvc</p:Name><p:PathName>C:\Windows\system32\svchost.exe -k netsvcs</p:PathName><p:ProcessId>1108</p:ProcessId><p:ServiceSpecificExitCode>0</p:ServiceSpecificExitCode><MORE AND MORE>PS> $x=[xml](winrm e wmi/root/cimv2/win32_service "-format:pretty")PS> $xResults-------ResultsPS> $x.resultswsman Win32_Service----- -------------http://schemas.dmtf.org/wbem/wsman... {AeLookupSvc, ALG, Appinfo, AppMgm...PS> $x.results.Win32_service |sort State,Name |ft -group State name,Caption-autoState: RunningName Caption---- -------AeLookupSvc Application ExperienceAppinfo Application InformationAppMgmt Application ManagementASFIPmon Broadcom ASF IP and SMBIOS Mailbox Monitor<MORE AND MORE>State: StoppedName Caption---- -------ALG Application Layer Gateway Serviceaspnet_state ASP.NET State Serviceclr_optimization_v2.0.50727_32 Microsoft .NET Framework NGEN v2.0...<MORE AND MORE>PS>
Cheers!
Jeffrey Snover [MSFT]Windows Management Partner ArchitectVisit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShellVisit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx