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
5
votes
0 answers

Has anyone been able to establish a WinRM remote powershell session to a Windows Docker container?

I have two non-domain VMs. Both running the same version of PowerShell. One of the VMs is hosting a transparent-networked Docker container of WindowsServerCore. The non-Docker VM has * for the trusted machines. The Docker container has…
jermny
  • 870
  • 2
  • 12
  • 23
5
votes
1 answer

Issues of executing remote powershell script using cake-build

I am trying to execute following test.ps1 script param([string]$name,[string]$password); write-Output "Hello $($name) my password is $($password)"; dir c:\ New-Item c:\HRTemp\test.txt -ItemType file on remote server using following…
bumbeishvili
  • 1,342
  • 14
  • 27
5
votes
1 answer

How to get *tmux* experience using Powershell to work remotely on a Windows server?

For remote work on a Linux server, I can ssh and then tmux to resume my work (including stdout/stderr). How can I get the same experience on Windows server using Powershell? I have done some basic reading on Enter-PSSession but that feels like ssh…
Fabian
  • 990
  • 3
  • 11
  • 24
5
votes
3 answers

Powershell 4.0 Transcript is not capturing output of Write-Host statements

I have created following script(test.ps1) and I am executing it from command line as "powershell .\test.ps1" Write-Host(Start-Transcript -Path "D:\logs.txt") $remoteScript = { Write-Host "Remote Log" } Invoke-Command -ConnectionUri $uri…
5
votes
1 answer

API access to PowerShell Web Access?

PowerShell Web Access allows you to run PowerShell cmdlets through a web browser. It shows a web based console window. Is there any way to run cmdlets without typing them in to the console window? And is there any way to get the results back? I'm…
5
votes
2 answers

How to run interactive commands in another application window from powershell

I have another command line program which I invoke from my powershell script and would like to run some interactive commands in that window once it is opened from power shell. In other words - I do a Invoke-Item $link_to_app which opens up the…
user1575430
  • 51
  • 1
  • 1
  • 2
5
votes
3 answers

Invoke-Command with dynamic function name

I found this awesome post: Using Invoke-Command -ScriptBlock on a function with arguments I'm trying to make the function call (${function:Foo}) dynamic, as in I want to pass the function name. I tried this: $name = "Foo" Invoke-Command -ScriptBlock…
Dennis G
  • 21,405
  • 19
  • 96
  • 133
5
votes
1 answer

Remote PowerShell sessions from C# under ApplicationPoolIdentity

Using a Library I found from Microsoft, I have been attempting (with C#) to provision email accounts for my users with Live@Edu and the library uses remote PowerShell sessions to do this. I have wrapped the PowerShell calls with a using() { } block…
kd7iwp
  • 3,110
  • 8
  • 30
  • 39
4
votes
2 answers

Powershell Stop-Process null param when calling in foreach loop

I have the following tiny PowerShell script that's meant to kill some certain processes on a remote machine: $destPS = "mywebserver1" $brokerPIDs = Get-Process -ComputerName $destPS | ?{$_.processname -eq "uniRQBroker" -or $_.processname -eq…
Mark Henderson
  • 2,586
  • 1
  • 33
  • 44
4
votes
6 answers

Customer refuses "scripts" in the environment. How do I embed a *.ps1 in a C# app?

I have the following sample Powershell script that is embedded in my C# application. Powershell Code $MeasureProps = "AssociatedItemCount", "ItemCount", "TotalItemSize" $Databases = Get-MailboxDatabase -Status foreach($Database in…
makerofthings7
  • 60,103
  • 53
  • 215
  • 448
4
votes
1 answer

How can I use cdb.exe in an interactive Powershell Remoting session

I am using cdb.exe to debug a service remotely. To ease this, I've been trying to use a powershell remoting session to do the work. However, I am running into behavior I don't understand. This works new-pssession | enter-pssession (in the…
Taylor Bird
  • 7,767
  • 1
  • 25
  • 31
4
votes
1 answer

Powershell Remote session and Git Credential Manager on Windows Server

I am accessing server via PS remote session. I am trying to run a git pull from a github repo. The git credentials on the remote machine are stored in Windows Credential Manager. However I get this error: fatal: Unable to persist credentials with…
4
votes
0 answers

IIS sites creation failed - The object identifier does not represent a valid object. (Exception from HRESULT: 0x800710D8)

I have written a PowerShell script block for creating IIS app pool and website on Azure Virtual Machine Scale Set multiple instances, while the script block runs parallel, I get the error The object identifier does not represent a valid…
4
votes
1 answer

Powershell Get-EventLog returning events one at a time

EDIT 9/26/2011: Still looking for an answer, if you have any ideas please post and let me know! Summary of problem When I run Get-EventLog against my own computer or a nearby computer, I don't see anything unusual and everything works as…
Nick Knowlson
  • 7,185
  • 6
  • 47
  • 63
4
votes
0 answers

Change Remote PowerShell reconnection timeout

When I have a Remote PowerShell session opened and the TCP stops working (e.g. power shut/cable disconnected/...), the Invoke-Command or Remove-PSSession commands block for a few minutes trying to reconnect. I want to reduce this timeout to 5…
Axel Williot
  • 485
  • 6
  • 13