Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PSJob+WinRM=Connection attempt failed.

59 views
Skip to first unread message
Message has been deleted

aja...@bk.ru

unread,
Mar 11, 2008, 2:02:11 PM3/11/08
to
Please help me to deside, where is error:

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}

Marco Shaw [MVP]

unread,
Mar 11, 2008, 2:00:54 PM3/11/08
to
> 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

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

aja...@bk.ru

unread,
Mar 11, 2008, 2:37:26 PM3/11/08
to
On 12 мар, 04:00, "Marco Shaw [MVP]" <marco.shaw@_NO_SPAM_gmail.com>
wrote:

NO IIS (I'm under XP Home Edition)
Please, tell whether there is a bug in the code above?
Thank you for attention.

Marco Shaw [MVP]

unread,
Mar 11, 2008, 2:59:57 PM3/11/08
to

> 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

ajax76

unread,
Mar 11, 2008, 3:20:46 PM3/11/08
to
On 12 мар, 04:59, "Marco Shaw [MVP]" <marco.shaw@_NO_SPAM_gmail.com>
wrote:

> > 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-po...

>
> 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?

Marco Shaw [MVP]

unread,
Mar 11, 2008, 3:32:59 PM3/11/08
to

> 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

RichS

unread,
Mar 11, 2008, 3:41:00 PM3/11/08
to
You can have multiple PS windows running on XP Home - no problem.

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

ajax76

unread,
Mar 11, 2008, 4:01:36 PM3/11/08
to
The answer is No.
Can you tell what services SHOULD BE run except WinRM

Marco Shaw [MVP]

unread,
Mar 11, 2008, 5:40:57 PM3/11/08
to
ajax76 wrote:
> The answer is No.
> Can you tell what services SHOULD BE run except WinRM

Only winrm....

No, you can't run 2 PSH consoles at the same time?

Marco

Marco Shaw [MVP]

unread,
Mar 11, 2008, 5:40:29 PM3/11/08
to
RichS wrote:
> You can have multiple PS windows running on XP Home - no problem.
>
> I'm seeing the same problem on Vista SP1 - which is odd as I remember
> testing out PSjobs last year.

Run PSH as Admin and retry.

Marco

RichS

unread,
Mar 11, 2008, 6:46:03 PM3/11/08
to
Check you have the Common files from IIS installed - you need the HTTP
service to be available

--
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

ajax76

unread,
Mar 11, 2008, 6:59:13 PM3/11/08
to
On 12 мар, 07:40, "Marco Shaw [MVP]" <marco.shaw@_NO_SPAM_gmail.com>
wrote:

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:\>

Message has been deleted
Message has been deleted
Message has been deleted

Marco Shaw [MVP]

unread,
Mar 11, 2008, 9:23:32 PM3/11/08
to
RichS wrote:
> Check you have the Common files from IIS installed - you need the HTTP
> service to be available

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

Marco Shaw [MVP]

unread,
Mar 11, 2008, 9:25:03 PM3/11/08
to

> 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

Have you tried this also?

Marco

Marco Shaw [MVP]

unread,
Mar 11, 2008, 9:24:19 PM3/11/08
to
ajax76 wrote:
> On 12 мар, 07:40, "Marco Shaw [MVP]" <marco.shaw@_NO_SPAM_gmail.com>
> wrote:
>> ajax76 wrote:
>>> The answer is No.
>>> Can you tell what services SHOULD BE run except WinRM
>> Only winrm....
>>
>> No, you can't run 2 PSH consoles at the same time?
>>
>> Marco
>
> I can run 2 psh simultaneously.
> About runspace:
>
> PS C:\>
> $rs=[System.Management.Automation.Runspaces.RunspaceFactory]::CreateRunspace()
> PS C:\> $rs

This is not the same thing as creating a runspace with new-runspace.
For one, this way doesn't startup another PowerShell process.

Marco

ajax76

unread,
Mar 11, 2008, 10:27:57 PM3/11/08
to
On 12 мар, 11:25, "Marco Shaw [MVP]" <marco.shaw@_NO_SPAM_gmail.com>
wrote:

> > 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-po...

>
> Have you tried this also?
>
> 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:\>

ajax76

unread,
Mar 11, 2008, 10:33:24 PM3/11/08
to
> This is not the same thing as creating a runspace with new-runspace.
> For one, this way doesn't startup another PowerShell process.

Could you to describe (or give link) all difference.


ajax76

unread,
Mar 11, 2008, 10:40:06 PM3/11/08
to
About you debate with Richard Siddaway:

WinRM service is WORK! Real problem is Runspace.
For what reasons can be denied access

Marco Shaw [MVP]

unread,
Mar 11, 2008, 11:03:49 PM3/11/08
to

I can't provide this at this time.

I think we really need to see a ProcessMonitor trace, like I previously
mentioned...

Marco

ajax76

unread,
Mar 12, 2008, 12:00:14 AM3/12/08
to
PM trace: (powershell already started)

...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

ajax76

unread,
Mar 12, 2008, 12:11:40 AM3/12/08
to
PM trace: (powershell already started)

...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

RichS

unread,
Mar 12, 2008, 6:33:16 AM3/12/08
to
In Vista SP1 if you want to use runspaces and psjobs then you need to make
sure that:

- 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

ajax76

unread,
Mar 12, 2008, 9:14:00 AM3/12/08
to
On 12 мар, 20:33, RichS <Ri...@discussions.microsoft.com> wrote:
> In Vista SP1 if you want to use runspaces and psjobs then you need to make
> sure that:
>
> - 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

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)?

RichS

unread,
Mar 12, 2008, 2:41:03 PM3/12/08
to
No -its a Vista thing but for XP make sure you have win-rm running, you have
run the configure-wsman.ps1 script and that the HTTP SSL service is running

--
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

ajax76

unread,
Mar 12, 2008, 7:23:42 PM3/12/08
to
WinRM is ok.
This is problem:

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.

0 new messages