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

PowerShell Remote sessions and scope question: Commands appear to run locally

Here's a sample script that attempts to create a remote session on a server, then use WMI to get a list of the server's IIS application pools, and list their names: function Test-Remoting { [CmdletBinding()] param ( …
Moskie
  • 1,277
  • 2
  • 16
  • 23
3
votes
3 answers

Get Java version from PowerShell of remote server

I am trying to write a script in PowerShell that will use the invoke command with credentials on a remote machine to execute code that will return a string containing the Java version on that machine. Java is not installed, sometimes it is just…
alexfvolk
  • 1,810
  • 4
  • 20
  • 40
3
votes
2 answers

Enable PowerShell remoting on new Azure VM

I've created a new VM in Windows Azure to use to act as a host to learn a bit of Powershell Remoting. After the VM was created I RDP'd onto the box and enabled remoting via the following command: Enable-PSRemoting I confirmed both prompts with 'a'…
LDJ
  • 6,896
  • 9
  • 52
  • 87
3
votes
1 answer

Check remote PowerShell session status in C#

I create PowerShell Remoting session per the following code: AuthenticationMechanism auth = AuthenticationMechanism.Negotiate; WSManConnectionInfo ci = new WSManConnectionInfo( false, sRemote, 5985, @"/wsman", …
Vic
  • 1,985
  • 1
  • 19
  • 30
3
votes
6 answers

How to create a local windows user account using remote powershell?

tried creating users with powershel.This worked fine for local machine. But how to create a local user account in a remote machine using remote powershell? The script localwindows.ps1 is $comp = [adsi]'WinNT://machinename,computer'; $user =…
cmm user
  • 2,426
  • 7
  • 34
  • 48
3
votes
1 answer

Why does the Windows Remote Management service insist on being "delayed start"?

I'm running into some issues with the WinRM service. It constantly insists on being a "delayed start (automatic)" service instead of just "automatic". Why? This is causing issues for my VMs (on Hyper-V). I revert them programatically by PowerShell…
tnw
  • 13,521
  • 15
  • 70
  • 111
3
votes
0 answers

get list of all the tasks of a remote windows machine from linux machine

Is it possible to get list of tasks running in a remote windows box from linux machine ? we can use tasklist with remote switch but you have do that from another windows machine. is there a way to access same information from linux machine.
Lohith MV
  • 3,798
  • 11
  • 31
  • 44
3
votes
2 answers

In PowerShell how to copy files from a Remote PSsession to another Windows server

I am trying to copy a folder from one remote server to another inside a PSSession, it's giving errors like access is denied. I have admin privileges to both of the servers. If I try it without PSSession it works. In remote serverA PS…
3
votes
5 answers

PowerShell ScriptBlock and multiple functions

I have written the following code: cls function GetFoo() { function GetBar() { $bar = "bar" $bar } $foo = "foo" $bar = GetBar $foo $bar } $cred = Get-Credential "firmwide\srabhi_adm" $result =…
Knows Not Much
  • 30,395
  • 60
  • 197
  • 373
3
votes
2 answers

powershell Foreach-Object

I have this array (simplyfied): $v = 3,5,3,6,8,3,5,7 I need to check if all the values are higher than 3. I think that Foreach or Foreach-Object will be suitable for this task, but I can't figure out the way it works. I've tried something like…
culter
  • 5,487
  • 15
  • 54
  • 66
3
votes
1 answer

CredSSP PowerShell Session fails when using Kerberos for machine authentication

We are attempting to use CredSSP authentication for multi-hop PowerShell remoting, and one of our clients is running into a snag that prevents them from creating PSSessions using CredSSP when specifying the FQDN of the target server. Both server and…
Jamie Macia
  • 1,129
  • 1
  • 9
  • 10
3
votes
2 answers

Copy folder from remote machine (Azure) to remote machine

I have two machines say Machine-A: An azure vm role on cloud. Machine-B: A machine on my network domain. I can remote login to both MachineA and MachineB (using RDP) and copy say a folder 'temp' from location \MachineA.cloudapp.net\C$\temp to…
dushyantp
  • 4,398
  • 7
  • 37
  • 59
3
votes
1 answer

PowerShell create remote instance of IE with Invoke-Command

I'm trying to spawn an IE instance remotely via PowerShell. Invoke-Command -computername foo -scriptblock { $ie = New-Object -ComObject InternetExplorer.Application $ie.Visible = $true $ie.Navigate("http://duckduckgo.com") } It spawns…
baudtack
  • 29,062
  • 9
  • 53
  • 61
3
votes
1 answer

Remotely running Get-EventLog wipes actual event log

I wrote a script to remotely fetch event logs in PowerShell, but I'm not a fan of the way the script makes its own event log entries. Specifically this script grabs several types of event IDs including the logon/logoff events. Recently I was asked…
Boeckm
  • 3,264
  • 4
  • 36
  • 41
2
votes
1 answer

powershell remote jobs

Why am I getting the error for the code below: Get-Job -Id 1 | Select-Object -ExpandProperty childjobs | Where-Object {$_.state -eq 'Completed'} | Select-Object -ExpandProperty id | Receive-Job Receive-Job : The input object cannot be bound to…
resolver101
  • 2,155
  • 11
  • 41
  • 53