PS C:\> $job=Start-PSJob -command 'ls -rec c:\'
PS C:\> $job.JobStateInfo.state
Failed
PS C:\> $job.ChildJobs[0].JobStateInfo.Reason
Connection attempt failed.
PS C:\> Get-ExecutionPolicy
Unrestricted
PS C:\> (Get-Service -name 'winrm').status
Running
PS C:\> winrm id
IdentifyResponse
ProtocolVersion = http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd
ProductVendor = Microsoft Corporation
ProductVersion = OS: 5.1.2600 SP: 2.0 Stack: 1.1
PS C:\> netsh firewall show portopening
Port Protocol Mode Name
-------------------------------------------------------------------
80 TCP Enable HTTP
443 TCP Enable HTTPS
PS C:\> (winrm e wmi/root/cimv2/win32_operatingsystem)|
?{$_ -match '(caption|version)'}
Caption = Microsoft Windows XP Home Edition
CSDVersion = Service Pack 2
PlusVersionNumber = null
ServicePackMajorVersion = 2
ServicePackMinorVersion = 0
Version = 5.1.2600
PS C:\> $PSVersionTable
Name Value
---- -----
CLRVersion 2.0.50727.1433
BuildVersion 6.1.6480.1
PSVersion 2.0
PSCompatibleVersions {1.0, 2.0}
Are you also running IIS? If so, stop the admin,www, and ftp services
and retry (assuming you don't have a problem stopping them).
There is an issue with XPSP2/IIS/winrm 1.1 that hasn't been officially
documented yet, as far as I know.
Marco
NO IIS (I'm under XP Home Edition)
Please, tell whether there is a bug in the code above?
Thank you for attention.
Everything looks good from what I can tell. Can you try this method
just to compare whether it works:
http://blogs.msdn.com/powershell/archive/2008/02/29/remoting-using-powershell-v1.aspx
Also check to see if all of this works (in order):
$r=new-runspace
get-runspace
remove-runspace $r
Marco
PS C:\> $r=new-runspace
New-Runspace : [localhost] Access denied.
At line:1 char:16
+ $r=new-runspace <<<<
What's wrong?
I'm not all that familiar with XP Home... Are you able to have 2 or
more PowerShell consoles running at the same time? Basically, a
runspace is practically the same as a PowerShell instance, but it cannot
interact with the Desktop. *-PSJob uses these runspaces to run things
in the background...
Might want to try Process Explorer
(http://www.microsoft.com/technet/sysinternals/Utilities/ProcessMonitor.mspx)
for us to see what might be failing...
Marco
I'm seeing the same problem on Vista SP1 - which is odd as I remember
testing out PSjobs last year.
--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk
Only winrm....
No, you can't run 2 PSH consoles at the same time?
Marco
Run PSH as Admin and retry.
Marco
I can run 2 psh simultaneously.
About runspace:
PS C:\>
$rs=[System.Management.Automation.Runspaces.RunspaceFactory]::CreateRunspace()
PS C:\> $rs
RunspaceConfiguration :
System.Management.Automation.Runspaces.RunspaceConfigForSingleShell
InitialSessionState :
Version : 2.0
RunspaceStateInfo : BeforeOpen
InstanceId : d5c86182-8165-4da6-ac10-ae9e3fe9f951
SessionStateProxy :
System.Management.Automation.Runspaces.SessionStateProxy
Debugger :
PS C:\> Get-Runspace
PS C:\>
Actually, winrm depends on HTTP.sys on the server-side and winhttp.dll
on the client side.
You do not need to have IIS installed to use winrm or PowerShell v2
remoting.
Marco
Have you tried this also?
Marco
This is not the same thing as creating a runspace with new-runspace.
For one, this way doesn't startup another PowerShell process.
Marco
Did you mean it
PS C:\> Winrs "-r:localhost" PowerShell -NoProfile -NonInteractive
start-psjob -command 'l
s -rec c:\'
Winrs error:Access denied. PS C:\>
Could you to describe (or give link) all difference.
WinRM service is WORK! Real problem is Runspace.
For what reasons can be denied access
I can't provide this at this time.
I think we really need to see a ProcessMonitor trace, like I previously
mentioned...
Marco
...New-Runspace...
RegOpenKey HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds SUCCESS
RegQueryValue HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds
\PipelineMaxStackSizeMB NAME NOT FOUND
Thread Create SUCCESS
QueryOpen C:\WINDOWS\assembly\GAC_MSIL
\Microsoft.PowerShell.Commands.Utility
\1.0.0.0__31bf3856ad364e35\Microsoft.PowerShell.Commands.Utility.dll
SUCCESS
QueryOpen C:\WINDOWS\assembly\GAC_MSIL\System.Management.Automation
\1.0.0.0__31bf3856ad364e35\System.Management.Automation.dll SUCCESS
QueryOpen C:\WINDOWS\system32\wsmsvc.dll SUCCESS
QueryOpen C:\WINDOWS\system32\wsmsvc.dll SUCCESS
QueryOpen C:\WINDOWS\system32\wsmsvc.dll SUCCESS
QueryOpen C:\WINDOWS\system32\wsmsvc.dll SUCCESS
QueryOpen C:\WINDOWS\system32\wsmsvc.dll SUCCESS
RegOpenKey HKCU SUCCESS
RegOpenKey HKCU\Software\Policies\Microsoft\Control Panel\Desktop NAME
NOT FOUND
RegOpenKey HKCU\Control Panel\Desktop SUCCESS
RegQueryValue HKCU\Control Panel\Desktop\MultiUILanguageId SUCCESS
RegCloseKey HKCU\Control Panel\Desktop SUCCESS
RegCloseKey HKCU SUCCESS
RegOpenKey HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WSMAN\Client
SUCCESS
RegQueryValue HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WSMAN
\Client\BackwardsCompatibleEncryptionFormat NAME NOT FOUND
RegCloseKey HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WSMAN
\Client SUCCESS
RegOpenKey HKLM\Software\Microsoft\windows\CurrentVersion\Internet
Settings\Connections NAME NOT FOUND
RegQueryValue HKLM\System\CurrentControlSet\Services
\WinSock2\Parameters\Protocol_Catalog9\Serial_Access_Num SUCCESS
RegOpenKey HKLM\System\CurrentControlSet\Services\WinSock2\Parameters
\Protocol_Catalog9\00000024 NAME NOT FOUND
Thread Create SUCCESS
Thread Create SUCCESS
RegCloseKey HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds SUCCESS
RegOpenKey HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds SUCCESS
Thread Exit SUCCESS
RegQueryValue HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds
\PipelineMaxStackSizeMB NAME NOT FOUND
Thread Create SUCCESS
QueryOpen C:\WINDOWS\assembly\GAC_MSIL
\Microsoft.PowerShell.Commands.Management
\1.0.0.0__31bf3856ad364e35\Microsoft.PowerShell.Commands.Management.dll
SUCCESS
Thread Exit SUCCESS
Thread Create SUCCESS
Thread Exit SUCCESS
...Start-PSJob -command 'ls c:\'...
RegOpenKey HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds SUCCESS
RegQueryValue HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds
\PipelineMaxStackSizeMB NAME NOT FOUND
Thread Create SUCCESS
QueryOpen C:\WINDOWS\assembly\GAC_MSIL
\Microsoft.PowerShell.Commands.Utility
\1.0.0.0__31bf3856ad364e35\Microsoft.PowerShell.Commands.Utility.dll
SUCCESS
QueryOpen C:\WINDOWS\assembly\GAC_MSIL\System.Management.Automation
\1.0.0.0__31bf3856ad364e35\System.Management.Automation.dll SUCCESS
QueryOpen C:\WINDOWS\system32\wsmsvc.dll SUCCESS
QueryOpen C:\WINDOWS\system32\wsmsvc.dll SUCCESS
QueryOpen C:\WINDOWS\system32\wsmsvc.dll SUCCESS
QueryOpen C:\WINDOWS\system32\wsmsvc.dll SUCCESS
QueryOpen C:\WINDOWS\system32\wsmsvc.dll SUCCESS
RegOpenKey HKCU SUCCESS
RegOpenKey HKCU\Software\Policies\Microsoft\Control Panel\Desktop NAME
NOT FOUND
RegOpenKey HKCU\Control Panel\Desktop SUCCESS
RegQueryValue HKCU\Control Panel\Desktop\MultiUILanguageId SUCCESS
RegCloseKey HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds SUCCESS
RegCloseKey HKCU\Control Panel\Desktop SUCCESS
RegCloseKey HKCU SUCCESS
RegCloseKey HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds SUCCESS
RegOpenKey HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WSMAN\Client
SUCCESS
RegQueryValue HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WSMAN
\Client\BackwardsCompatibleEncryptionFormat NAME NOT FOUND
RegCloseKey HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WSMAN
\Client SUCCESS
RegOpenKey HKLM\Software\Microsoft\windows\CurrentVersion\Internet
Settings\Connections NAME NOT FOUND
- win-rm is running
- you run the configure-wsman.ps1 that comes with the CTP
- you have the .NET 3.0 Windows Communication Foundation HTTP activation
feature loaded
--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk
Hello, Richard.
PS C:\> (Get-Service -name 'winrm').status
Running
So it configured and running.
About WCF http activation - is it necessary under XP Home (no IIS)?
PS C:\> winrs -r:localhost list c:\
Winrs error:Access denied. PS C:\>
And I have not forgotten press enter - so it looks on screen.
I just rewrote <Access denied> in English.