powershell-remoting

What permissions are required for a Release Management 2013 vNext release using Powershell

时光毁灭记忆、已成空白 提交于 2019-12-08 00:24:37
问题 I've configured the deployment to a web server using a service account. On the target machine remote powershell is enabled and the account has been added to the Remote Management Users group. I initiate a release and the following error occurs. If I add the service account to the local Administrators group on the web server then it succeeds. I can reproduce the same error by remoting into the web server, under the service account, and attempting to call get-service . System.AggregateException

Powershell logging from invoke-command

早过忘川 提交于 2019-12-07 11:36:31
问题 I have a script that includes a function for logging. The function writes log to $msg variable then writes the message to the screen. i can redirect this output to a .txt file for logging. I need to run the script to multiple servers using invoke-command and write the log output to a txt file on the computer running the script. I am trying to figure out how to output $msg in the write-log function from the PSSession and return it so I can create a master log file for all the servers. Should I

Error PSRemoting using Session and CredSSP

半城伤御伤魂 提交于 2019-12-07 10:31:21
问题 I use Windows 8.1 Enterprise 64 bit and Powershell 4.0. I want execute powershell remoting and using authentication CredSSP. I open Console Powershell, run as Administrator, and execute Enter-PSSession command to connect to remote computer. But I get error about connection. PS C:\Documents and Settings\kiquenet> Enter-PSSession -ComputerName DC -credential devrsg.com\Administrator Anyways, I test command from Windows XP and Windows 7, and connection is OK. PS C:\Documents and Settings

Powershell v2 remoting and delegation

Deadly 提交于 2019-12-07 07:27:16
问题 I have installed Powershell V2 on 2 machines and run Enable-PsRemoting on both of them. Both machines are Win 2003 R2 and are joined to the same active directory domain and I can successfully run commands remotely. So PS remoting is working between the local server and remote server. But when I try to access a share on a 3rd server (dir \someOtherServer\builds), which is also Win 2003 R2 and joined to the same active directory, I get the error: Get-ChildItem : Cannot find path '

How to access NoteProperties on the InputObject to a remoting session

*爱你&永不变心* 提交于 2019-12-07 05:36:03
问题 I'm having difficulty accessing PSObject s with NoteProperties defined, that are being passed through to a remote session via Invoke-Command . The reason I am constructing an object for this purpose is that I need access to two separate pieces of information in the remote session, but PowerShell only provides for a single InputObject . My code looks something like this: $sessionInput = new-object -TypeName System.Object $sessionInput | Add-Member -MemberType NoteProperty -Name NoteProperty1

Powershell 2.0 Remoting loading a .Net 4.0 dll

喜你入骨 提交于 2019-12-07 01:13:40
问题 I am trying to load a .Net 4.0 assembly, using [Reflection.Assembly]::LoadFrom, inside of a remote Powershell 2.0 session. It works locally, due to a change I made to the powershell.exe.config file, but fails with a "This assembly is built by a runtime newer ..." exception in a remote session. Both machines involved have .Net 2.0 and 4.0, and have the powershell.exe.config change for the x86 and x64 bit powershell executables. I've also tried changing the server powershell registry keys: HKLM

Why would a get-process -computername return a couldn't connect to remote machine error?

旧巷老猫 提交于 2019-12-06 13:04:18
I can execute the following command on a specific machine and it can return a list of processes on several target computers but returns a "Couldn't connect to remote machine" error on one machine. get-process -ComputerName 192.168.1.101 None of the target machines have powershell installed. The machine I am executing the powershell script on has 2.0 installed. I have admin privileges on all machines. The target machines that are able to return a list of processes remotely are server 2003 Standard Edition with SP 1. The target machine that does not return a list of processes remotely is server

PowerShell ScriptBlock and multiple functions

末鹿安然 提交于 2019-12-06 12:04:29
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 = Invoke-Command -Credential $cred -ComputerName localhost -ScriptBlock ${function:GetFoo} Write-Host $result[0] Write-Host $result[1] It works but I don't want to define GetBar inside of GetFoo . Can I do something like this? cls function GetBar() { $bar = "bar" $bar } function GetFoo() { $foo = "foo" $bar = GetBar $foo $bar } $cred = Get-Credential "firmwide\srabhi_adm" $result = Invoke-Command

What permissions are required for a Release Management 2013 vNext release using Powershell

穿精又带淫゛_ 提交于 2019-12-06 10:30:47
I've configured the deployment to a web server using a service account. On the target machine remote powershell is enabled and the account has been added to the Remote Management Users group. I initiate a release and the following error occurs. If I add the service account to the local Administrators group on the web server then it succeeds. I can reproduce the same error by remoting into the web server, under the service account, and attempting to call get-service . System.AggregateException: Cannot open Service Control Manager on computer '.'. This operation might require other privileges.

Extremely slow Powershell remote execution?

冷暖自知 提交于 2019-12-06 06:36:46
Is there any way to speed up powershell remoting? Right now, to execute a "remote" command on my VM, it takes about 30-90 seconds just do do a simple hello world using Invoke-Command with credentials. If I run commands right after that initial execution, I don't get any delay. However, if I wait 3-4 minutes I see a big spike in delay again (30-90 seconds). I've also tried using Enter-PSSession and the same thing happens (for the initial command it's slow, then fast, until I don't issue commands for 3-4 minutes, at which point it slows to a crawl again.) I've tried using sessions (and