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
2 answers

VSTS Azure File Copy task - Access denied

The VSTS task - Azure File Copy keeps giving me an access denied error, even though I have configured WinRM over HTTPS for my Azure VM. I am running the build agent locally (not hosted) and from my machine, I am successfully able to PsRemote into my…
3
votes
4 answers

Get-WinEvent via Powershell remoting

I have a non-admin access to a server. I'm allowed to connect via RDP, and to use PowerShell remoting. When I invoke the following PowerShell command from an RDP session: Get-WinEvent -MaxEvents 100 -Provider Microsoft-Windows-TaskScheduler I get…
Seva Alekseyev
  • 59,826
  • 25
  • 160
  • 281
3
votes
1 answer

Change logon account of a service using powershell when password has special symbols

I'm running following powershell script to change logon user account of a remote service and then start it. $result = $remoteService.Change($null,$null,$null,$null,$null,$null,$logonAccount, $logonPassword,$null,$null,$null) if…
sunny days
  • 837
  • 1
  • 13
  • 26
3
votes
1 answer

How to pass -Verbose parameter to a function called inside Invoke-Command?

I have the following function that I am trying to invoke remotely with verbose output, but I don't know how to pass the VerbosePreference correctly? function TestVerbose() { [CmdletBinding()] Param() Write-Output "output test" …
tholesen
  • 460
  • 5
  • 10
3
votes
3 answers

The term 'Add-AzureAccount' is not recognized as the name of a cmdlet, function, script file

I am trying to use this azure commandlets form C# application that is console job hosted in my azure Virtual machine. this job runs more then once in a day automatically but my azure commandlets are fails to execute. yesterday that works fine but…
3
votes
0 answers

PSSession error: The maximum number of concurrent shells for this user has been exceeded

I started a few PSSessions through the New-PSsession cmdlet These sessions were not closed, when I tried to open another session I got the following error message: New-PSsession : Connecting to remote server serverName failed with the following…
ShaneC
  • 2,237
  • 2
  • 32
  • 53
3
votes
2 answers

Using Powershell Invoke-Command on remote session to invoke executable by string

I want to write a Powershell script to invoke an executable on a remote machine by its path and then wait for it to finish running. This is what I've got so far: $executable = "C:\Temp\example.exe" $session = New-PSSession -ComputerName…
Void Star
  • 2,401
  • 4
  • 32
  • 57
3
votes
1 answer

Using Get-DnsServerResourceRecord Remotely Against Another Domain

Im trying to run the following $secpasswd = 'Test' $secpasswd = ConvertTo-SecureString $secpasswd -AsPlainText -Force $mycreds = New-Object System.Management.Automation.PSCredential ('domain2\nick', $secpasswd) [scriptblock]$CheckDNS =…
NickBuckley
  • 77
  • 1
  • 1
  • 9
3
votes
1 answer

Invoke-Command with script block is not working on remote machine with no error

I am trying to call a batch file located in local machine executing the below PowerShell command from remote computer. Invoke-Command -ComputerName XXXXXX -ScriptBlock { Start-Process "c:\installagent.bat" } -Credential abc\XXX It's not giving…
3
votes
1 answer

How do Powershell scheduled job InstanceIds work?

I am trying to manage instances of scheduled jobs using the Job cmdlets such as Get-Job and Wait-Job. I am having problems and have the feeling that I am missing something fundamental. I have found that I should be importing the PSScheduledJob…
Scott Munro
  • 13,369
  • 3
  • 74
  • 80
3
votes
1 answer

Exchange Remote Powershell gets sporadic 'Broken' state

I am trying receive the status of all TransportAgents from an remote Exchange Server through Windows Powershell. I sporadically receive an error, that the The session state is Broken. Once it is broken I need to create a new Session Below a list of…
Ole K
  • 754
  • 1
  • 9
  • 32
3
votes
2 answers

Converting a value to corresponding text

I am trying to get my script finished for checking powershell versions on remote machines, and I am now down to one last part, I am getting a version number of the file back from powershell but I am looking for a way to turn 6.2.1200.XXX to Version…
Luke
  • 647
  • 1
  • 8
  • 22
3
votes
1 answer

Set Executable's Working Directory When PowerShell Remoting

I'm using PowerShell remoting to execute an exe file on a remote server. The problem is that the exe needs to have its Working Directory set to the directory that the exe is in for it to run properly. If I run the exe locally (on the server) from a…
deadlydog
  • 22,611
  • 14
  • 112
  • 118
3
votes
3 answers

Install .msi remotely using Powershell

I have made he following code using the code present on this forum. cls $computername = Get-Content 'C:\Users\C201578-db\Documents\server.txt' $sourcefile =…
3
votes
3 answers

Issues with Invoke-Command while installing softwares in remote server

I need to install an application in several remote servers in quiet mode. I have created a script (Installer.ps1) like below using Powershell v3.0: param( [String] $ServerNameFilePath = $(throw "Provide the path of text file which contains the…
skjcyber
  • 5,759
  • 12
  • 40
  • 60