powershell-remoting

PowerShell remoting: Controlling what edition is being targeted (PowerShell Core or Windows PowerShell); the state of cross-platform remoting

橙三吉。 提交于 2019-12-01 10:47:26
问题 This self-answered question, which focuses on Windows [1] , addresses the following aspects: Now that there are two PowerShell editions - the legacy, Windows-only Windows PowerShell and the cross-platform PowerShell Core , both may be installed on a given Windows machine: How can I tell which PowerShell edition will execute remote commands , such as via Invoke-Command -ComputerName ? How can I target a specific edition , both ad hoc and persistently , through configuration? Note: For an

Running Java remotely using PowerShell

廉价感情. 提交于 2019-12-01 03:55:36
When I run PowerShell in a remote session ( etsn {servername} ), I sometimes can't seem to run Java processes, even the most simple: [chi-queuing]: PS C:\temp> java -cp .\hello.jar Hello Error occurred during initialization of VM Could not reserve enough space for object heap Hello.jar is an "Hello, world!" application that should just print "Hello" to standard output . So, the question is, is there something special about running processes on the other side of a PowerShell session? Is there something special about how the Java VM works that might not allow treatment like this? The memory is

Reading event log remotely with Get-EventLog in Powershell

偶尔善良 提交于 2019-12-01 03:19:31
I've a powershell script which runs on server(test-server) and reads the log file of his client(DC1). Both sides can ping to each other. On both sides, firewalls are disabled. Remote Desktop and Remote Assistance are enabled on DC1. Get-EventLog System -ComputerName test-server -Source Microsoft-Windows-Winlogon # WORKS Get-EventLog System -ComputerName DC1 -Source Microsoft-Windows-Winlogon # DOESN'T WORK I run this script on test-server. As you see when I read the local log file on test-server it works fine but if I try to read the log file of DC1 remotely I get the error " Get-EventLog :

Running Java remotely using PowerShell

拜拜、爱过 提交于 2019-12-01 00:51:57
问题 When I run PowerShell in a remote session ( etsn {servername} ), I sometimes can't seem to run Java processes, even the most simple: [chi-queuing]: PS C:\temp> java -cp .\hello.jar Hello Error occurred during initialization of VM Could not reserve enough space for object heap Hello.jar is an "Hello, world!" application that should just print "Hello" to standard output. So, the question is, is there something special about running processes on the other side of a PowerShell session? Is there

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

三世轮回 提交于 2019-11-30 17:14:49
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 server xxx failed with the following error message : WinRM cannot process the request. The following error occurred while using Kerberos authentication: Cannot find the computer xxx. Verify that the computer exists on the network and that the name provided is spelled correctly.* It doesn't matter if I use just the server name or if I enter it fully qualified.

PowerShell Remoting giving “Access is Denied” error

↘锁芯ラ 提交于 2019-11-30 13:10:11
问题 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 no trust in place between these domains The Server in Domain B is running Exchange 2010, and I can run Exchange 2010 Specific commands against it from Server A using this command: $Session = New-PSSession -ConfigurationName Microsoft.Exchange

How can I get 7za.exe to run via Powershell Remoting?

 ̄綄美尐妖づ 提交于 2019-11-30 12:56:26
问题 I've tried a number of different ways to do this, they all result in the same error. Here is one set of commands: $s = New-PSsession -ComputerName ServerA $job = Invoke-Command -Session $s -Scriptblock { Start-Process -FilePath "C:\Scripts\ArchiveEventLogs\ver4.5\7za.exe" -ArgumentList "a", "C:\Scripts\Eventlogs.bak\ServerA-20101111.7z", "C:\Scripts\Eventlogs.bak\*.evt*", "-mx7", "-oC:\Scripts\Eventlogs.bak", "-wC:\Scripts\Eventlogs.bak", "-t7z" -Wait } -AsJob Get-Job | Wait-Job Receive-Job

Run my third-party DLL file with PowerShell

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 10:59:43
问题 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 run. using EOserverAPI; ... private void myButton_Click(object sender, EventArgs e) { String MDSConnString="Data Source=MSI;Initial Catalog=EOMDS;Integrated Security=True;"; //Create the connection IEOMDSAPI myEOMDSAPI = EOMDSAPI.Create(MDSConnString); /

How to run interactive commands in another application window from powershell

旧城冷巷雨未停 提交于 2019-11-30 09:35:53
问题 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 interactive command line for that application and now I would like to use the application specific commands from within powershell scripts. e.g. app.exe -help to invoke the help command of the app.exe . Any pointers would help. Thanks! 回答1: Try this:

PowerShell Remoting giving “Access is Denied” error

戏子无情 提交于 2019-11-30 06:38:13
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 no trust in place between these domains The Server in Domain B is running Exchange 2010, and I can run Exchange 2010 Specific commands against it from Server A using this command: $Session = New-PSSession -ConfigurationName Microsoft.Exchange –ConnectionUri $ConnectionURI -Credential $Credentials -Authentication Basic Import-PSSession $Session The