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
19
votes
1 answer

How do I host a Powershell script or app so it's accessible via WSManConnectionInfo? (like Office 365)

The only ways I know to connect to a remote runspace include the following parameters WSManConnectionInfo connectionInfo = new WSManConnectionInfo(false, "localhost", 80, "/Powershell",…
makerofthings7
  • 60,103
  • 53
  • 215
  • 448
19
votes
3 answers

How to Write-Verbose from Invoke-Command?

In powershell Write-Verbose and the -Verbose flag are used to provide verbose information when commands are run in verbose mode. I am running some scripts remotely and would like to capture the verbose output output. However, Invoke-Command seems to…
George Mauer
  • 117,483
  • 131
  • 382
  • 612
16
votes
7 answers

Powershell Remoting: using imported module cmdlets in a remote pssession

Is there a way to use modules that were imported in a local session in a remote session? I looked at import-pssession, but I don't know how to get the local session. Here's a sample of what I want to do. import-module…
16
votes
1 answer

WinRM cannot process the request - fails only over a specific domain

Some of ours servers (W2K8 R2) were moved to the cloud last week, once done that my powerswhell script started to fail (was working fine before), the exception is thrown on the line where the connection is trying to be established, $ExSession =…
g3n1t0
  • 161
  • 1
  • 1
  • 3
13
votes
2 answers

Release Management vNext Component Deployment Bottleneck

We're using Release Management 2015 with vNext release templates. We have a Powershell DSC based component deployment for each of the portions of our application, and in fact, we have two distinct applications being deployed and that are in active…
RMD
  • 3,421
  • 7
  • 39
  • 85
12
votes
1 answer

how to get winrm to use powershell 7 for remote sessions by default

With the release of powershell 7, seems like it is time to move past ps 5.1 so I have installed in on a couple of servers to give it a go. However I when I create a session to these servers from my pc with ps7 I am always running ps5.1 on the remote…
Alexis Coles
  • 1,227
  • 14
  • 19
12
votes
4 answers

What does it mean that powershell 2.0 will be "firewall friendly"?

I'm interested in executing powershell scripts on a computer behind a firewall. What ports will I need to have open? Will any special configuration be needed or I'll be just be able to connect to a fresh install of Windows Server 2008 r2 and start…
sumek
  • 26,495
  • 13
  • 56
  • 75
12
votes
2 answers

How can I get 7za.exe to run via Powershell Remoting?

I've tried a number of different ways to do this, they all result in the same error. Here is one set of commands: $s = New-PSsession -ComputerName ServerA $job = Invoke-Command -Session $s -Scriptblock { Start-Process -FilePath …
Sean
  • 1,065
  • 2
  • 10
  • 10
12
votes
2 answers

How do I pass a local variable to a remote `Invoke-Command`?

I'm trying to retrieve the hash of a file located on remote server using Invoke-Command. It works fine when I give the full path as below: Invoke-Command -ComputerName winserver -ScriptBlock { Get-FileHash -Path E:\test\testfile.zip -Algorithm…
Bose
  • 143
  • 1
  • 2
  • 10
12
votes
5 answers

Powershell Remoting Profiles

How do I use a function in my profile on the remote machine when using Enter-PSSession on my local machine to open a remote PowerShell session.
general exception
  • 4,202
  • 9
  • 54
  • 82
12
votes
2 answers

Reading event log remotely with Get-EventLog in Powershell

I've a powershell script which runs on server(test-server) and reads the log file of his client(DC1). Both sides can ping to each other. On both sides, firewalls are disabled. Remote Desktop and Remote Assistance are enabled on DC1. Get-EventLog…
Korki Korkig
  • 2,736
  • 9
  • 34
  • 51
12
votes
1 answer

Creating a registry key with path components via PowerShell

For a legacy application, I need to create a registry key with a name in the format c:/foo/bar/baz. (Note: forward slashes, not backslashes.) To be clear: that is a single key's name, with forward slashes, that otherwise looks like a Windows path.…
Benjamin Pollack
  • 27,594
  • 16
  • 81
  • 105
11
votes
1 answer

Launching background tasks in a remote session that don't get killed when the session is removed

I have been using PsExec -d to launch console applications in a remote powershell session because I want these apps to run in the background while I perform some task. The problem is that I want the background applications to continue running even…
David K.
  • 6,153
  • 10
  • 47
  • 78
11
votes
3 answers

Clickable hyperlink on PowerShell's console output

I'm having some issues with the following PowerShell script, could you please help me with that? What I'm trying to accomplish is create a clickable hyperlink in PowerShell's console output. Something like that: $testOutPut =…
user1809439
  • 111
  • 1
  • 1
  • 4
11
votes
1 answer

Powershell, svn, and authentication

I can remote desktop into a given machine and run svn, without giving authentication information, and it works; my AD authentication allows me access to the repository I want. I can use Powershell to connect to the machine and execute svn commands,…
Yamikuronue
  • 746
  • 8
  • 37
1
2
3
82 83