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.

1050 questions
155
votes
9 answers

Using PowerShell credentials without being prompted for a password

I'd like to restart a remote computer that belongs to a domain. I have an administrator account but I don't know how to use it from powershell. I know that there is a Restart-Computer cmdlet and that I can pass credential but if my domain is for…
all eyez on me
  • 1,553
  • 2
  • 10
  • 5
67
votes
7 answers

Powershell remoting with ip-address as target

I successfully enabled PSRemoting on my Server 2008 R2. I'm able to do a remote-pssession from within the same network using the hostname as target. I'm failing when I try to use the IP-Address as target from any computer (within the network or from…
wullxz
  • 13,928
  • 8
  • 27
  • 44
41
votes
1 answer

Enter-PSSession is not working in my Powershell script

When I run the lines below from a script the file ends up being created on my local machine. $cred = Get-Credential domain\DanTest Enter-PSSession -computerName xsappb01 -credential $cred New-Item -type file…
Dan Snell
  • 1,995
  • 2
  • 18
  • 33
38
votes
6 answers

How to import custom PowerShell module into the remote session?

I'm developing a custom PowerShell module, which I'd like to use in context of a remote session to a different computer. The following code (which obviously doesn't work) explains what I'm trying to achieve: import-module…
Yan Sklyarenko
  • 29,347
  • 24
  • 104
  • 125
36
votes
9 answers

how to edit a file in powershell remoting session (powershell)

I am connecting to another computer using powershell remoting, really nice. can do lots, but how do I edit a file? PS C:\Users\guutlee> Enter-PSSession -ComputerName appprod [appprod]: PS C:\Users\guutlee\Documents> cd \myapp [appprod]: PS…
guutlee
  • 403
  • 1
  • 5
  • 7
33
votes
4 answers

How do I include a locally defined function when using PowerShell's Invoke-Command for remoting?

I feel like I'm missing something that should be obvious, but I just can't figure out how to do this. I have a ps1 script that has a function defined in it. It calls the function and then tries using it remotely: function foo { …
David Hogue
  • 1,740
  • 1
  • 14
  • 23
32
votes
4 answers

Run my third-party DLL file with PowerShell

I am not sure if this is possible or not with PowerShell. But basically I have a Windows Forms program that configures a program called EO Server. The EO Server has an API, and I make a reference to EOServerAPI.dll to make the following code…
MicroSumol
  • 1,294
  • 6
  • 20
  • 32
27
votes
4 answers

Powershell remoting - Policy does not allow the delegation of user credentials

I'm new to powershell and I'm having troubles using credentials delegation. I have the following script: $session = New-PSSession myserver -Authentication CredSSP -Credential DOMAIN\Administrator Invoke-Command -Session $session -ScriptBlock {
ChrisB
  • 757
  • 2
  • 7
  • 16
27
votes
2 answers

PowerShell Remoting giving "Access is Denied" error

I am trying to use PowerShell Remoting to check some disk sizes from a Server in a remote domain, but the commands I am running are failing to work. The situation is like this: Source Server is in Domain A Destination Server is in Domain B There is…
HungryHippos
  • 1,303
  • 5
  • 15
  • 24
26
votes
3 answers

How to execute a powershell script available in remote machine?

I was trying to execute a script in remote computer. I did "Enable-PSremoting" in the remote machine. I placed a script hello.ps1 in remote machine. [My client machine is Windows XP and remote computer is Windows 2003 ] Then from my client computer…
Samselvaprabu
  • 13,922
  • 28
  • 113
  • 200
23
votes
10 answers

Stop Powershell from exiting

I know that there is that little -noexit switch for PowerShell. Is there anyway of staying in the shell without using that switch? In other words, I want a script command(s) that executes then leaves the shell open.
rhavin
  • 1,296
  • 1
  • 9
  • 30
21
votes
7 answers

Confusing Powershell behavior

Am a bit confused w/ remote executing a powershell command. I have a test server (Win 2k8-R2-SP1) called ServerA, which has powershell remoting enabled correctly. From my dev machine (Win 2k8-R2-SP1), am able to remote execure powershell commands…
Prasanna K Rao
  • 1,066
  • 1
  • 8
  • 18
21
votes
5 answers

Enter-PSSession to remote server fails with "cannot find the computer"

My desktop is win7 and I am trying to connect to a server 2012. Both hosts are on the same domain. If I do: Enter-PSSession -ComputerName *ServerName*** I get the following failure message from winrm Enter-PSSession : Connecting to remote…
user333869
  • 411
  • 1
  • 3
  • 11
20
votes
1 answer

Powershell - Find the user who invoked the script

I have a script(Let's call it myPSScript.ps1) which takes two parameters and performs predefined steps. Script is located in a Windows Server box which people login and execute the script. Supports two users to be logged in at the given time. I want…
Sanjeev
  • 653
  • 4
  • 10
  • 19
20
votes
2 answers

Running remote GUI app in Powershell

We have a custom comonent that wraps some of the functionality of powershell so it can be used frim BizTalk 2006. For most operations (checking a file path, copy or move a file) this works fine. However we have the need to fire up a GUI app…
Stefan John Park
  • 201
  • 1
  • 2
  • 5
1
2 3
69 70