Questions tagged [powershell-remoting]

The ability to create a remote connection, in an other way than using WMI, is the most important difference between PowerShell v 1.0 and 2.0.

Host applications can use a PowerShell object to run commands that use WS-Management-based Windows PowerShell remoting to create a temporary or persistent connection to the remote computer. This includes establishing an interactive session with a single remote computer.

1238 questions
4
votes
1 answer

Error PSRemoting using Session and CredSSP

I use Windows 8.1 Enterprise 64 bit and Powershell 4.0. I want execute powershell remoting and using authentication CredSSP. I open Console Powershell, run as Administrator, and execute Enter-PSSession command to connect to remote computer. But I…
Kiquenet
  • 14,494
  • 35
  • 148
  • 243
4
votes
0 answers

Multiple processes wsmprovhost.exe do not terminate after closing remote PowerShell sessions

I am connecting to remote computers from C# application using PowerShell Remoting (directly from C# code). That works fine, however every such connection leaves a new instance of process wsmprovhost.exe (WSMan host process) lingering on the target…
Cozzamara
  • 1,318
  • 1
  • 14
  • 22
4
votes
2 answers

Get-Process to remote computer doesn't work but Invoke-Command does

I have a 2 servers running Windows Server 2012 R2. One of them is hosting a virtual machine running Windows 7 32-bit, and I am trying to use the other server to view the currently running processes of the virtual machine. I had to use…
Milto007
  • 68
  • 1
  • 1
  • 5
4
votes
0 answers

PS Remote session without passing credentials

I want to start a New-PSSession without having to pass credentials in a script. I know you can get the password from a file or have it hardcoded in the script and then convert it to a secure string to start the session. However, I want to start the…
CodeEmpower
  • 635
  • 1
  • 11
  • 29
4
votes
1 answer

Using Powershell RunspacePool multithreaded to remote server from C#

I am trying to create some C# code using a Powershell RunspacePool to a remote server. All is working well when maxRunspaces is set to 1, but setting it to 2 gives troubles. var connectionInfo = new WSManConnectionInfo(target, shellUri,…
Jaap
  • 2,252
  • 2
  • 20
  • 24
4
votes
2 answers

Invoke-command fails until I run winrm quickconfig on remote server

I'm trying to run a batch script on a remote server via powershell. Pretty straight forward: $password = ConvertTo-SecureString "password" -AsPlainText -Force $cred= New-Object System.Management.Automation.PSCredential ("domain\user",…
tnw
  • 13,521
  • 15
  • 70
  • 111
4
votes
1 answer

How can I expose an embedded PowerShell runspace to remoting

I have an ASP.Net application which can run embedded runspaces for which I have built a fairly extensive PowerShell functionality including: Interactive console, and Web base ISE-like UI a number of commandlets exposing the app functionality &…
Adam Najmanowicz
  • 1,200
  • 6
  • 10
4
votes
2 answers

Powershell logging from invoke-command

I have a script that includes a function for logging. The function writes log to $msg variable then writes the message to the screen. i can redirect this output to a .txt file for logging. I need to run the script to multiple servers using…
GreetRufus
  • 421
  • 2
  • 9
  • 19
4
votes
2 answers

PowerShell Workflow Exchange Remoting

I'm attempting to pull data from Office 365 Exchange Online in parallel to save time. I'm not able to accomplish what I'm looking to do, the following code is the "closest" I've come so far. Workflow Get-MailboxStatisticsParallel{ param…
4
votes
2 answers

Powershell v2 remoting and delegation

I have installed Powershell V2 on 2 machines and run Enable-PsRemoting on both of them. Both machines are Win 2003 R2 and are joined to the same active directory domain and I can successfully run commands remotely. So PS remoting is working between…
SM.
  • 101
  • 3
  • 7
4
votes
3 answers

PSRemoting performance overhead with get-childItem

This completes in 2.3 minutes on LOCALSERVER: A: measure-command {$x = invoke-command {gci -recurse "C:\"}} This completes in 38.4 minutes on LOCALSERVER: B: measure-command {$x = invoke-command -comp LOCALSERVER {gci -recurse "C:\"}} Why is B…
noam
  • 1,914
  • 2
  • 20
  • 26
4
votes
3 answers

Run a local function on a remote computer?

I have a simple function on my computer MYPC> $txt = "Testy McTesterson" MYPC> function Do-Stuff($file) { cd c:\temp; $txt > $file; } I would like to run it on a remote computer MYPC> Invoke-Command -ComputerName OTHERPC { Do-Stuff…
George Mauer
  • 117,483
  • 131
  • 382
  • 612
4
votes
3 answers

maximum data size in a remote command

my powershell script sends a file to several clients within customised session using following code (code is shortened) function DoCopyFile { param( [Parameter(Mandatory=$true)] $RemoteHost, [Parameter(Mandatory=$true)] $SrcPath, …
sardok
  • 1,086
  • 1
  • 10
  • 19
4
votes
2 answers

Script to export to excel

I Have below script:-- looking for help to convert the output to excel format $servers = get-content “c:\list.txt” foreach ($server in $servers) { $server $command = “quser /server:” + $server invoke-expression $command } when executed getting in…
4
votes
2 answers

Why does TFS Authentification fail from remote PowerShell session?

When I run the following PowerShell script directly on a machine Add-Type -Path "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v2.0\Microsoft.TeamFoundation.VersionControl.Client.dll" $basePath =…
bernd_k
  • 11,558
  • 7
  • 45
  • 64