Code Monkey home page Code Monkey logo

psl-omi-provider's Introduction

PowerShell Remoting Protocol Build Status

PSRP communication is tunneled through the Open Management Infrastructure (OMI) using this OMI provider.

Two parts of PSRP are available - server and client. The client PSRP part (libpsrpclient) is under development, and will be distributed together with PowerShell. The server PSRP package is available now and should be installed after installing OMI as it is an OMI provider.

Get PSRP-Server

You can download and install PSRP-Server from following links:

Platform Releases Link
Linux Debian psrp-1.4.1-28.universal.x64.deb
Linux RPM psrp-1.4.1-28.universal.x64.rpm

Alternatively, you can now also download from Microsoft Repo. Instructions on setting this up can be found here. Follow the instructions for your platform. You can then use your platform's package tool to install OMI (i.e. "sudo apt-get install omi-psrp-server", or "sudo yum install omi-psrp-server").

Package Requirement

Prior to installing PSRP, make sure that OMI and PowerShell are installed.

Development Environment

Toolchain Setup

PSRP has OMI as a submodule so install those dependencies first. Instructions are located in the build-omi README.md.

PSRP requires the following additional dependent packages:

  • On Ubuntu 14.04 and Ubuntu 16.04
sudo apt-get install cmake
  • On CentOS 7.x
sudo yum install cmake

Also install PowerShell from the latest release per their instructions.

Git Setup

PSRP has a submodule, so clone recursively.

git clone --recursive https://github.com/PowerShell/psl-omi-provider.git

Building

Run make debug or make release to build OMI and the provider.

In debug mode, this script first builds OMI in developer mode:

pushd omi/Unix
./configure --dev
make -j
popd

Then it builds and registers the provider:

pushd src
cmake -DCMAKE_BUILD_TYPE=Debug .
make -j
popd

In release mode, this script will build omi, the provider, and packages (for distribution).

Running

Connecting from Windows to Linux

Some initial setup on Windows is required. Open an administrative command prompt and execute the following:

winrm set winrm/config/Client @{TrustedHosts="*"}

You can also set the TrustedHosts to include the target's IP address.

Then on Linux, launch omiserver (if you installed OMI from its installation package, omiserver is probably already running):

./run.sh

Now in a PowerShell prompt on Windows (opened after setting the WinRM client configurations):

$cred = Get-Credential
$o = New-PSSessionOption -SkipCACheck -SkipRevocationCheck -SkipCNCheck
Enter-PSSession -ComputerName <IP address of Linux machine> -Credential $cred -Authentication basic -UseSSL -SessionOption $o

The IP address of the Linux machine can be obtained with:

ip -f inet addr show dev eth0

Connecting from Linux to Windows

For Centos 7.3 and later, and Ubuntu 16.04 or later, Powershell supports Secure Protected Negotiated authentication (SPNEGO). This allows the use of NTLM based authentication and encryption of traffic over the http connection. Use of SPNEGO authentication is more secure than basic authentication on http, and less complex than https. Support of NTLM authentication on MacOS is deprecated by apple. We are currently working on Kerberos protocol support which will allow SPNEGO or direct Kerberos authentication on MacOS as well as at least some older Linux distributions.

In order to perform NTLM authentication there must be matching credentials on both ends of the transaction. The necessary setup of the ntlm credentials for both server and client is described in the document setup-ntlm-omi.

Note that the server side will need an additional registry setting to enable administrators, other than the built in administrator, to connect using NTLM. Refer to the LocalAccountTokenFilterPolicy registry setting under Negotiate Authentication in Authentication for Remote Connections

If you are not using SPNEGO authentication, or wish to use basic authentication on http, the WinRM server needs to be configured to allow unencrypted traffic and accept basic authentication for inbound connections. Note that this sends passwords over unencrypted http. We do not recommend it. If the http socket is enabled and basic authentication is allowed, there is currently no way to prevent the use of basic authentication over http, which exposes passwords.

To enable basic auth, on Windows in an administrative command prompt run:

winrm set winrm/config/Service/Auth @{Basic="true"}

Basic authentication has acceptable security over https, but all communications using basic authentication over http are unencrypted. Connections using SPNEGO authentication are encrypted, and have acceptable security.

To enable unencrypted communication over http on Windows in an administrative command prompt you must also run:

winrm set winrm/config/Service @{AllowUnencrypted="true"}

Basic authentication with WinRM can only access local machine accounts so you will need to create a local account on your Windows machine that is part of the administrator group.a SPNEGO connections can use domain credentials.

Building this repository generates two new binaries that need to be picked up instead of the ones included by PowerShell for Linux itself. Run PowerShell as:

export LD_LIBRARY_PATH=psl-omi-provider-path/src:psl-omi-provider-path/omi/Unix/output/lib:${LD_LIBRARY_PATH} && powershell

where psl-omi-provider-path is where you enlisted your psl-omi-provider code.

Now in PowerShell prompt on Linux you can connect to Windows using this command:

$cred = Get-Credential
Enter-PSSession -ComputerName <IP address of windows machine> -Credential $cred -Authentication basic

psl-omi-provider's People

Contributors

andyleejordan avatar bettyboy avatar dantramsft avatar daxian-dbw avatar jeffaco avatar jumpingyang001 avatar krisbash avatar niroyb avatar palladia avatar paulcallen avatar yakman2020 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

psl-omi-provider's Issues

Regression bug: PSRP client on Linux throws ERROR_WSMAN_SCHEMA_VALIDATION_ERROR when ConfigurationName is used.

Opening the issue here, as requested by @SteveL-MSFT in PowerShell/PowerShell#3186

I'm trying to use psl-omi-provider (client) to connect from Linux to Windows.
It works fine on any version I've tried (alpha 14-16) if I use default configuration (not using ConfigurationName parameter).

When I use this parameter in alpha 14 it also works fine. Unfortunately, both alpha 15 and 16 will report issue with schema:

$ps2 = New-PSSession -ComputerName jumpbox -Credential $cred -Authentication basic -ConfigurationName DnsAdminRole

New-PSSession : [jumpbox] Connecting to remote server jumpbox failed with the following error message : 
ERROR_WSMAN_SCHEMA_VALIDATION_ERROR: The SOAP XML in the message does not match the corresponding XML schema definition. 
Change the XML and retry.  For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:8
+ $ps2 = New-PSSession -ComputerName jumpbox -Credential $cred -Authent ...
+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
    + FullyQualifiedErrorId : 1,PSSessionOpenFailed

Communicate features in progress

Hello,

I believe that @paulcallen, @palladia, and @yakman2020 have a few features in progress to eliminate these two required steps:

winrm set winrm/config/Service @{AllowUnencrypted="true"}
winrm set winrm/config/Service/Auth @{Basic="true"}

I'm being asked for progress on that, and realized that we don't have a list anywhere public of features currently in progress. Is this something we could provide, either in the readme or in a set of issues?

Arch Linux repos

I think so many more people would use it (including me) if they could just type pacaur -S psrp or something. Correctly I have to compile 3 different things

"TERM environment variable not set" when typing in "clear"

After setting up PSRP on Linux, I remote connected from windows and issued the clear command. When I do this the screen does not clear and I am given the error "TERM environment variable not set.". It is a minor thing, but I am interested to find out if there is a way to make the clear command over PSRP to Linux.

PSRP logging through OMI needs improvements

Currently, the PSRP provider through OMI uses OMI's logging capabilities. This is problematic in several ways:

  1. Frequently, it's better to debug PSRP independently from OMI, and
  2. PSRP, running as @requestor@, does not actually have permissions to write to OMI's logging directory.

As a short term hack to get logging running, you can do the following:

  • chmod 777 /var/opt/omi/log
  • Enable debug logging in /etc/opt/omi/conf/omiserver.conf
  • PSRP server will log to the /var/opt/omi/log/ShellServer.log.

This, of course, has the disadvantage that anybody on the system can write freely to /var/opt/omi/log.

A much better logging mechanism is to do what SCX does:

  1. Create a small EXEC program, similar to SCX's tool, to create directory /var/opt/microsoft/psrp/log/<username>, where that directory is owned by the user in question,
  2. Have a separate configuration file that PSRP reads to determine if it should log or not,
  3. Have a logging directory explicitly for PSRP, perhaps in /var/opt/microsoft/psrp/log.
    • If the requester is root, then the log file is created in that directory (no subdirectory is created),
    • If the requester is non-root, use the new directory. Due to omi-preexec having been run, permissions will be set so that user can write the log into that directory.

This would vastly simplify and improve the PSRP provider's logging mechanism.

Error thrown when initiating NEW-PSSession to Centos Linux

Clean compile of OMI and PSL-OMI-Provider
Providing userid of root and matching password when prompted for Get-Credential on Windows.

PS D:> $o=New-PSSessionOption -SkipCACheck -SkipRevocationCheck -SkipCNCheck
PS D:> New-PSSession -Computername 10.254.0.130 -Credential $c -Authentication basic -UseSSL -SessionOption $o
New-PSSession : The type initializer for 'System.Management.Automation.ConfigPropertyAccessor' threw an exception.
At line:1 char:1

  • New-PSSession -Computername 10.254.0.130 -Credential $c -Authenticati ...
  • - CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], RemoteException
    - FullyQualifiedErrorId : PSSessionOpenFailed
    

The SSL certificate is expired

When I do enter-pssession from windows powershell I see below error, Is there any documentation for this.
My centos version is CentOS Linux release 7.5.1804 (Core)

Enter-PSSession : Connecting to remote server centos.vcloud-lab.com failed with the following error message : The
server certificate on the destination computer (centos.vcloud-lab.com:5986) has the following errors:
The SSL certificate is expired. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
Enter-PSSession -ComputerName centos.vcloud-lab.com -Credential $cred ...
CategoryInfo : InvalidArgument: (centos.vcloud-lab.com:String) [Enter-PSSession], PSRemotingTransportEx
ception
FullyQualifiedErrorId : CreateRemoteRunspaceFailed

Remove Pester submodule

@JumpingYang001 confirmed internally that no changes will be made to Pester, and that the PowerShell 6.0 packages will be installed for testing purposes. As these packages include the Pester PowerShell module, the submodule introduced in #42 is unnecessary.

Trying to copy file from Windows to Linux hangs

Installed on Suse 12 with SP2 the following
powershell-6.0.4-1.rhel.7.x86_64
omi-1.4.3-1.x86_64 for the installed SSL 1.0.2
omi-psrp-server-1.4.2-2.x86_64

I am trying to run on Windows the following but Copy-Item hangs:

$SecurePass = ConvertTo-SecureString -String "root_password" -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential "root" , $SecurePass
$Opt = New-PsSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck
$Session = New-PsSession -Credential $Cred -ComputerName 11.0.0.21 -Port 5986 -Authentication Basic -SessionOption $Opt -UseSSL
Copy-Item -Path 'C:\Downloads\App-LinuxX86.tar' -Destination /home/user/ -ToSession $Session

Note: 11.0.0.21 is the Linux IP address.
Note 2: Enter-PSSession $Session works. Remote Powershell was configured OK.
Note 3: App-LinuxX86.tar has 300MB size.

omiserver.log says:
2018/08/27 16:59:55 [21765,21765] WARNING: null(0): EventId=30161 Priority=WARNING WsmanConnection: 0x2503e50 _ProcessInstanceConnectionData: expired
2018/08/27 16:59:55 [21765,21765] WARNING: null(0): EventId=30162 Priority=WARNING WsmanConnection: 0x2503e50 _ProcessResultConnectionData: no request
2018/08/27 16:59:55 [21765,21765] WARNING: null(0): EventId=30119 Priority=WARNING ssl-read: unexpected sys error 104

2018/08/27 16:59:55 [21765,21765] WARNING: null(0): EventId=30161 Priority=WARNING WsmanConnection: 0x2503e90 _ProcessInstanceConnectionData: expired
2018/08/27 16:59:55 [21765,21765] WARNING: null(0): EventId=30162 Priority=WARNING WsmanConnection: 0x2503e90 _ProcessResultConnectionData: no request
2018/08/27 16:59:58 [21765,21765] WARNING: null(0): EventId=30119 Priority=WARNING ssl-read: unexpected sys error 104

2018/08/27 16:59:58 [21765,21765] WARNING: null(0): EventId=30161 Priority=WARNING WsmanConnection: 0x2513110 _ProcessInstanceConnectionData: expired
2018/08/27 16:59:58 [21765,21765] WARNING: null(0): EventId=30162 Priority=WARNING WsmanConnection: 0x2513110 _ProcessResultConnectionData: no request

shellserver.log says
2018/08/27 16:37:14 [21164,21164] ERROR: null(0): Shell_Load PostResult 0x7ffd6cf8af80, 0
2018/08/27 16:44:40 [21441,21441] ERROR: null(0): Shell_Load PostResult 0x7ffcaa0d3400, 0
2018/08/27 16:51:14 [21795,21795] ERROR: null(0): Shell_Load PostResult 0x7ffc43f32410, 0

Cannot do a Kerberos/Negotiate authentification on remote windows if winrm AllowUnencrypted set to "false" on remote

When trying to log in with domain credential with the -Authentificate Negotiate I end up with an access denied if winrm AllowUnencrypted set to "false" on the remote, setting it to true gives me the expected return.

x.x.x.x] Connecting to remote server x.x.x.x failed with the following error message : MI_RESULT_ACCESS_DENIED For more information, see the about_Remote_Troubleshooting Help topic.
+ CategoryInfo : OpenError: (x.x.x.x:String) [], PSRemotingTransportException
+ FullyQualifiedErrorId : 2,PSSessionStateBroken

I've tried connection from a windows box and it works as expected with AllowUnencrypted set to "false" on the remote.

It's as if the windows remote wouldn't detect the linux connection as being encrypted..

Winrm config on remote :

PS C:\Windows\system32> .\winrm id
IdentifyResponse
ProtocolVersion = http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd
ProductVendor = Microsoft Corporation
ProductVersion = OS: 6.1.7601 SP: 1.0 Stack: 2.0

C:\Windows\system32> winrm get winrm/config/Service
Service
RootSDDL = O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;WD)(AU;SA;GWGX;;;WD)
MaxConcurrentOperations = 4294967295
MaxConcurrentOperationsPerUser = 15
EnumerationTimeoutms = 60000
MaxConnections = 25
MaxPacketRetrievalTimeSeconds = 120
AllowUnencrypted = false
Auth
Basic = true
Kerberos = true
Negotiate = true
Certificate = false
CredSSP = true [Source="GPO"]
CbtHardeningLevel = Relaxed
DefaultPorts
HTTP = 5985
HTTPS = 5986
IPv4Filter = * [Source="GPO"]
IPv6Filter = * [Source="GPO"]
EnableCompatibilityHttpListener = false
EnableCompatibilityHttpsListener = false
CertificateThumbprint

Initial Windows documented WinRM setup failing

  • Windows OS:
    Microsoft Windows [Version 10.0.16199.1000]

*Windows PowerShell:
PS C:\WINDOWS\system32> $PSVersionTable

Name Value


PSVersion 5.1.16199.1000
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16199.1000
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Issue:
I'm not sure what's wrong but when running initial steps to setup WinRM in Windows is failing:
PS C:\WINDOWS\system32> winrm set winrm/config/Client @{TrustedHosts="*"}
Error: Invalid use of command line. Type "winrm -?" for help.
PS C:\WINDOWS\system32>
PS C:\WINDOWS\system32> winrm set winrm/config/Service/Auth @{Basic="true"}
Error: Invalid use of command line. Type "winrm -?" for help.

Repro:

  1. Open Windows PowerShell as Adminstrator.
  2. Following steps on link: https://github.com/PowerShell/psl-omi-provider#connecting-from-linux-to-windows
    (Section: Connecting from Linux to Windows)

winrmerror_2017-05-28_9-43-01

Cannot connect to omi server since PowerShell v6.0.0-beta.3

I just upgraded from PowerShell v6.0.0-beta.2 to PowerShell v6.0.0-beta.3 and since then i am not able to connect from Windows to Linux with PowerShell Remoting:

Steps to reproduce:

On the Linux side:
sudo apt install powershell omi omi-psrp-server

On the Windows side:
$creds = Get-Credential
Enter-PSSession -ComputerName HOSTNAME -Credential $creds -Authentication Basic -SessionOption $(New-PSSessionOption -SkipCACheck -SkipCNCheck) -UseSSL

Logs:
2017/06/26 11:48:26 [3619,3619] WARNING: null(0): EventId=30058 Priority=WARNING failed to call provider's load with result 1; class: Shell
2017/06/26 11:48:26 [3619,3619] WARNING: null(0): EventId=30066 Priority=WARNING failed to open the provider psrpomiprov for class Shell
2017/06/26 11:48:26 [3619,3619] ERROR: null(0): EventId=20001 Priority=ERROR Agent _RequestCallback: ProvMgr_NewRequest failed with result 1 !

Regards
Richard

linux client connection to windows 10 using basic auth and unencrypted traffic doesn't work (MI_RESULT_ACCESS_DENIED)

On the freshly installed windows 10 machine I've run as Administrator:

# allow clear traffic and basic auth for both server and client
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic = true}'
winrm set winrm/config/client '@{AllowUnencrypted="true"}
winrm set winrm/config/client/auth '@{Basic = true}'

# allow connection from any host
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "*" -Force

# enable ps remoting
Enable-PSRemoting -SkipNetworkProfileCheck -Force

# add test user (admin group)
net user /add aapteladmin aapteladmin
net localgroup administrators aapteladmin /add

# simple local test is working (from win10 to itself)
enter-pssession -computername 192.168.100.215 -credential aapteladmin -authentication basic
(type aapteladmin as pw)
[192.168.100.215]: PS C:\Users\aapteladmin\Documents>

Now that I know it's working from windows I try from linux.

I've installed powershell from the microsoft rhel7 repos (Powershell v6.1.0-preview.1).

Here are the commit hash after the clone for the main and sub repos:

$ for d in . omi pal; do ( cd $d && echo -en "$d:\t" && git --no-pager log -n1 --pretty=oneline ); done
.:      2cbb1ae (HEAD -> master, origin/master, origin/dantra/issue112, origin/HEAD) Update README.md
omi:    1770fbe (HEAD, tag: v1.4.1-0) Resolve problems with psrp issues #437,#438,#439
pal:    60fdaa6 (HEAD) Adding log suppression messages

Building...

$ make debug
(ends successfully ... output here https://pastebin.com/raw/HaiW0PDU )

$ find -iname '*.so'
./omi/Unix/output/lib/libnits.so
./omi/Unix/output/lib/libnitsinj.so
./omi/Unix/output/lib/libnitssampleproduct.so
./omi/Unix/output/lib/libnitssample.so
./omi/Unix/output/lib/libnits_test_build_sample.so
./omi/Unix/output/lib/libmi.so
./omi/Unix/output/lib/libmi_origin.so
./omi/Unix/output/lib/libomiidentify.so
./omi/Unix/output/lib/libmicxx.so
./omi/Unix/output/lib/libomiclient.so
./omi/Unix/output/lib/libColor.so
./omi/Unix/output/lib/libConnector.so
./omi/Unix/output/lib/libConnectorProviderCXX.so
./omi/Unix/output/lib/libmifastener.so
./omi/Unix/output/lib/libNumber.so
./omi/Unix/output/lib/libnumberProvider.so
./omi/Unix/output/lib/libPersonProvider.so
./omi/Unix/output/lib/libPersonProviderCXX.so
./omi/Unix/output/lib/libPresidentProvider.so
./omi/Unix/output/lib/libDogProvider.so
./omi/Unix/output/lib/libDatetimeProvider.so
./omi/Unix/output/lib/libTesterProvider.so
./omi/Unix/output/lib/libTestClass_AllDMTFTypes.so
./omi/Unix/output/lib/libTest_SchemaRetrieval.so
./omi/Unix/output/lib/libtest_io.so
./omi/Unix/output/lib/libtest_mof.so
./omi/Unix/output/lib/libtest_base.so
./omi/Unix/output/lib/libtest_provreg.so
./omi/Unix/output/lib/libtest_provmgr.so
./omi/Unix/output/lib/libtest_micxx.so
./omi/Unix/output/lib/libtest_sock.so
./omi/Unix/output/lib/libtest_protocol.so
./omi/Unix/output/lib/libtest_http.so
./omi/Unix/output/lib/libtest_cli.so
./omi/Unix/output/lib/libtest_wsman.so
./omi/Unix/output/lib/libtest_wql.so
./omi/Unix/output/lib/libtest_strhash.so
./omi/Unix/output/lib/libtest_xml.so
./omi/Unix/output/lib/libtest_xmlserializer.so
./omi/Unix/output/lib/libtest_PersonProvider.so
./omi/Unix/output/lib/libtest_miapi.so
./omi/Unix/output/lib/libtest_oi.so
./omi/Unix/output/lib/libtest_mimofcodec.so
./omi/Unix/output/lib/libTestIndication.so
./omi/Unix/output/lib/libtest_indication.so
./omi/Unix/output/lib/libtest_pal.so
./omi/Unix/output/lib/libpsrpomiprov.so
./pal/test/ext/lib/hpux/ia64/cppunit/libcppunit.so
./pal/test/ext/lib/linux/ia32/cppunit/libcppunit.so
./pal/test/ext/lib/linux/x64/cppunit/libcppunit.so
./pal/test/ext/lib/solaris/ia32/cppunit/libcppunit.so
./pal/test/ext/lib/solaris/sparc/cppunit/libcppunit.so
./src/libpsrpomiprov.so
./src/libpsrpclient.so

Make didn't fail and all the libs seems to be built.

$ export LD_LIBRARY_PATH=$PWD/src:$PWD/omi/Unix/output/lib:$LD_LIBRARY_PATH
$ echo $LD_LIBRARY_PATH
/home/aaptel/prog/psl-omi-provider/src:/home/aaptel/prog/psl-omi-provider/omi/Unix/output/lib:
$ pwsh
PowerShell v6.1.0-preview.1
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/pscore6-docs
Type 'help' to get help.

PS /home/aaptel/prog/psl-omi-provider> Enter-PSSession -Computername 192.168.100.215 -Credential aapteladmin -Authentication Basic

PowerShell credential request
Enter your credentials.
Password for user aapteladmin: *********** (typed aapteladmin as pw)

Enter-PSSession : Connecting to remote server 192.168.100.215 failed with the following error message : MI_RESULT_ACCESS_DENIED For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ Enter-PSSession -Computername 192.168.100.215 -Credential aapteladmin ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (192.168.100.215:String) [Enter-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed

PS /home/aaptel/prog/psl-omi-provider>

I still get the same MI_RESULT_ACCESS_DENIED error (same as before using psl-omi-provider).

Intermittent hangs while establishing a WinRM connection from a Linux client to a Windows server

I'm trying to track down a hang that occurs intermittently but reliably (about 10-20% of the time) while connecting from a Linux client to a Windows server. When the connection is attempted, WinRM might not yet be running and/or the credentials we're trying to use might not yet be working, but instead of throwing an exception, the client simply hangs (forever, even if the server is shut down).

I've tried enabling OMI client logging, but strangely, when I set the log level to INFO or higher, the problem disappears, which makes me suspect a race condition either in this library or libmi. When the log level is left at the default value (WARNING), none of the OMI log files reference the server which the client is hanging trying to connect to, presumably because the connection handshake didn't progress far enough before it hung.

Can you give me any suggestions as to how I can capture additional details that will help us to track down the issue here?

Provider works only on Ubuntu 14.04.

Documentation suggests that PowerShell remoting requires only two elements:

  • OMI
  • PowerShell

We also have links to packages for general "Debian" and "RPM":

You can download and install PSRP-Server from following links:

Platform Releases Link
Linux Debian psrp-1.0.0-0.universal.x64.deb
Linux RPM psrp-1.0.0-0.universal.x64.rpm

Unfortunatelly, I managed to get it to work only on Ubuntu 14.04. I've tried CentOS 7.1, but even though OMI/PowerShell work fine, PowerShell remoting over WSMan was not possible. Could you please update docs to highlight current requirements and make sure that package works on other distributions that support OMI/PowerShell?

make "/bin/ld cannot find -lpam / -lssl / -lcrypto"

I'm attempting to compile the psl-omi-provider on CentOS 7.3. When I clone down the repository and run either "make debug" or "make release", I get the following error in the "Performing Building OMI" section:

========================= Performing Building OMI
( cd /home/james/downloads/psl-omi-provider/omi/Unix; make -f build.mak )
make[2]: Entering directory /home/james/downloads/psl-omi-provider/omi/Unix' make[3]: Entering directory /home/james/downloads/psl-omi-provider/omi/Unix/chkshlib'
mkdir -p /home/james/downloads/psl-omi-provider/omi/Unix/output/bin
g++ -o /home/james/downloads/psl-omi-provider/omi/Unix/output/bin/chkshlib /home/james/downloads/psl-omi-provider/omi/Unix/output/obj/chkshlib/chkshlib.o -L/home/james/downloads/psl-omi-provider/omi/Unix/output/lib -L -lpthread -ldl -lpam -lssl -lcrypto -Wl,-rpath=/opt/omi/lib
/bin/ld: cannot find -lpam
/bin/ld: cannot find -lssl
/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
make[3]: *** [/home/james/downloads/psl-omi-provider/omi/Unix/output/bin/chkshlib] Error 1
make[3]: Leaving directory /home/james/downloads/psl-omi-provider/omi/Unix/chkshlib' make[2]: *** [all] Error 2 make[2]: Leaving directory /home/james/downloads/psl-omi-provider/omi/Unix'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/james/downloads/psl-omi-provider/omi/Unix'
make: *** [release] Error 2

PowerShell Core Dbg.Assert when it unmarshals results from PSRP

For debug builds, WSManReceiveDataResult.Unmarshal hits a Dbg.Assert due the result data type being marked as Text instead of Binary (see https://github.com/PowerShell/PowerShell/blob/6febd1f8831ec4ab2127c4fef934484eb2ca374f/src/System.Management.Automation/engine/remoting/fanin/WSManNativeAPI.cs#L1937)

When debugging, the data is, in fact, binary and release builds work as expected since it doesn't validate the date type.

The impact is debug builds of PowerShell Core cannot be used with PSRP/Linux.

PowerShell Beta 9 causes a regression in the PSRP omi provider due to the name change to pswh.

See PowerShell/PowerShell#5246

startCoreCLR in coreclrutil.cpp (https://github.com/PowerShell/psl-omi-provider/blob/master/src/coreclrutil.cpp#L191) finds powershell's coreclr binary using the powershell binary. The change in name to pwsh breaks this logic.

$PSVersionTable
Name Value

PSVersion 6.0.0-beta.9
PSEdition Core
GitCommitId v6.0.0-beta.9
OS Linux 4.4.0-97-generic #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC 2017
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Issue with connecting from SLES to Windows

Hi,
I'm trying to connect from a SLES-12 machine to a windows machine. Have installed powershell, omi and psrp. Trying to connect using ntlm authentication. I followed the steps given in the link for ntlm setup - https://github.com/Microsoft/omi/blob/master/Unix/doc/setup-ntlm-omi.md. Tried this on Ubuntu as well as SLES. On Ubuntu, it is working fine. I am able to connect to the windows machine. The gssntlm library is not available in SLES and so had to build it from the link - https://github.com/simo5/gss-ntlmssp.
However, I'm getting the below error in case of SLES.

**Enter-PSSession : Connecting to remote server xx.xx.xx.xx failed with the following error message : acquiring creds with username only failed An invalid name was supplied SPNEGO cannot find mechanisms to negotiate For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1

  • Enter-PSSession -ComputerName xx.xx.xx.xx -Credential $cred -Authent ...
  • CategoryInfo : InvalidArgument: (xx.xx.xx.xx:String) [Enter-PSSession], PSRemotingTransportException
  • FullyQualifiedErrorId : CreateRemoteRunspaceFailed**

I used the following command on both Ubuntu and SLES to connect to the windows machine.
Enter-PSSession -ComputerName xx.xx.xx.xx -Credential $cred -Authentication negotiate
Please let me know what exactly the issue is or if there is anything wrong in the way I'm using this and also how this can be sorted.

Thank you.

New-PSSession to itself failed

Hi Guru,

New-PSSession to itself failed, I could not find the cause, could you please help? really appericate

PS /root> New-PSSession -Credential $credential -ComputerName 127.0.0.1 -Verbose -Authentication Basic -UseSSL -SessionOption (New-PSSessionOption -SkipCACheck -SkipRevocationCheck -SkipCNCheck)
New-PSSession : [127.0.0.1] Connecting to remote server 127.0.0.1 failed with the following error message : A general error occurred, not covered by a more specific error code. For more information, see the
about_Remote_Troubleshooting Help topic.
At line:1 char:1

  • New-PSSession -Credential $credential -ComputerName 127.0.0.1 -Verbos ...
  •   + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
      + FullyQualifiedErrorId : 1,PSSessionOpenFailed
    

PS /root>

root@pek2-gosv-16-dhcp167:~# sudo service omid status
● omid.service - OMI CIM Server
Loaded: loaded (/lib/systemd/system/omid.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2017-10-28 09:45:26 UTC; 9min ago
Process: 4175 ExecStop=/opt/omi/bin/omiserver -s (code=exited, status=0/SUCCESS)
Process: 4219 ExecStart=/opt/omi/bin/omiserver -d (code=exited, status=0/SUCCESS)
Process: 4179 ExecStartPre=/opt/omi/bin/support/installssllinks (code=exited, status=0/SUCCESS)
Main PID: 4223 (omiserver)
Tasks: 5 (limit: 512)
Memory: 3.4M
CPU: 362ms
CGroup: /system.slice/omid.service
├─4223 /opt/omi/bin/omiserver -d
├─4224 /opt/omi/bin/omiengine -d --logfilefd 3 --socketpair 9
├─4254 /opt/omi/bin/omiagent 9 10 --destdir / --providerdir /opt/omi/lib --loglevel WARNING
├─4363 /opt/omi/bin/omiagent 9 10 --destdir / --providerdir /opt/omi/lib --loglevel WARNING
└─4378 /opt/omi/bin/omiagent 9 10 --destdir / --providerdir /opt/omi/lib --loglevel WARNING

Oct 28 09:45:26 pek2-gosv-16-dhcp167 systemd[1]: Starting OMI CIM Server...
Oct 28 09:45:26 pek2-gosv-16-dhcp167 systemd[1]: omid.service: PID file /var/opt/omi/run/omiserver.pid not readable (yet?) after start: No such file or direc
Oct 28 09:45:26 pek2-gosv-16-dhcp167 systemd[1]: omid.service: Supervising process 4223 which is not our child. We'll most likely not notice when it exits.
Oct 28 09:45:26 pek2-gosv-16-dhcp167 systemd[1]: Started OMI CIM Server.

root@pek2-gosv-16-dhcp167:~# cat /var/opt/omi/log/omiserver.log
2017/10/28 08:04:52 [1980,1980] ERROR: null(0): EventId=20135 Priority=ERROR NTLM Credentials file does not exist or invalid permissions: null
2017/10/28 08:08:12 [1981,1981] WARNING: null(0): EventId=30107 Priority=WARNING Sock_Read: Error 9
2017/10/28 08:08:12 [1981,1981] WARNING: null(0): EventId=30112 Priority=WARNING Socket: 0xc31c80, Error: 1 while reading header

2017/10/28 08:08:12 [1981,1981] WARNING: null(0): EventId=30214 Priority=WARNING Selector_RemoveHandler: selector=0x5d1fc8, handler=0xc31c80, name=null NOT REGISTERED
2017/10/28 08:08:14 [2571,2571] ERROR: null(0): EventId=20135 Priority=ERROR NTLM Credentials file does not exist or invalid permissions: null
2017/10/28 08:32:40 [2572,2572] WARNING: null(0): EventId=30107 Priority=WARNING Sock_Read: Error 9
2017/10/28 08:32:40 [2572,2572] WARNING: null(0): EventId=30112 Priority=WARNING Socket: 0x15102e0, Error: 1 while reading header

2017/10/28 08:32:40 [2572,2572] WARNING: null(0): EventId=30214 Priority=WARNING Selector_RemoveHandler: selector=0x5d1fc8, handler=0x15102e0, name=null NOT REGISTERED
2017/10/28 09:37:50 [2572,2572] WARNING: null(0): EventId=30107 Priority=WARNING Sock_Read: Error 9
2017/10/28 09:37:50 [2572,2572] WARNING: null(0): EventId=30112 Priority=WARNING Socket: 0x1513350, Error: 1 while reading header

2017/10/28 09:37:50 [2572,2572] WARNING: null(0): EventId=30214 Priority=WARNING Selector_RemoveHandler: selector=0x5d1fc8, handler=0x1513350, name=null NOT REGISTERED
2017/10/28 09:39:30 [3927,3927] ERROR: null(0): EventId=20135 Priority=ERROR NTLM Credentials file does not exist or invalid permissions: null
2017/10/28 09:40:10 [3998,3998] ERROR: null(0): EventId=20135 Priority=ERROR NTLM Credentials file does not exist or invalid permissions: null
2017/10/28 09:42:09 [4093,4093] ERROR: null(0): EventId=20135 Priority=ERROR NTLM Credentials file does not exist or invalid permissions: null
2017/10/28 09:45:26 [4223,4223] ERROR: null(0): EventId=20135 Priority=ERROR NTLM Credentials file does not exist or invalid permissions: null
root@pek2-gosv-16-dhcp167:~#

Deadlocks in PSSession stack after closed connection

Cross-post from PowerShell/PowerShell#5685

Steps to reproduce

Test case 1:

$Session = New-PSSession -ComputerName $Computer -Credential $Cred -Authentication Negotiate
Invoke-Command -Session $Session -ScriptBlock {Write-Host '1st'}
$Session | Remove-PSSession
Write-Host '2nd'
$Session = New-PSSession -ComputerName $Computer -Credential $Cred -Authentication Negotiate
Invoke-Command -Session $Session -ScriptBlock {Write-Host '3rd'}
$Session | Remove-PSSession
Expected output:
1st
2nd
3rd
Outcome:
1st
2nd
[The script causes a hang here]

Test case 2:

$Sessions = New-Object System.Collections.ArrayList
$Session = New-PSSession -ComputerName $Computer -Credential $Cred -Authentication Negotiate
[void]$Sessions.Add($Session)
Invoke-Command -Session $Session -ScriptBlock {Write-Host '1st'}

$Session = New-PSSession -ComputerName $Computer -Credential $Cred -Authentication Negotiate
[void]$Sessions.Add($Session)
Invoke-Command -Session $Session -ScriptBlock {Write-Host '2nd'}

$Sessions | Remove-PSSession

Write-Host '3rd'
Expected output:
1st
2nd
3rd
Outcome:
1st
2nd
[The script causes a hang here]

Test case 3:

$Session = New-PSSession -ComputerName $Computer -Credential $Cred -Authentication Negotiate
Invoke-Command -Session $Session -ScriptBlock {Write-Host '1st'; Exit}
Write-Host '2nd'
$Session = New-PSSession -ComputerName $Computer -Credential $Cred -Authentication Negotiate
Invoke-Command -Session $Session -ScriptBlock {Write-Host '3rd'; Exit}
Expected output:
1st
2nd
3rd
Outcome:
1st
2nd
[The script causes a hang here]

Replacing $Session | Remove-Session with $Session.Runspace.Dispose() or $Session.Runspace.Close() causes the same behaviour. The behaviour occurs regardless of chosen Authentication method. The behaviour is not observed using SSH based sessions.

I am using ubuntu 16.04, with the following packages from the microsoft repo:

powershell 6.0.1-1.ubuntu.16.04
omi 1.4.2.1
omi-psrp-server 1.4.1.28

The error occurs reliably on every attempt and should be easy to reproduce.

PS /> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.0.1
PSEdition                      Core
GitCommitId                    v6.0.1
OS                             Linux 4.4.0-112-generic #135-Ubuntu SMP Fri Jan 19 11:48:36 UTC 2018
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

hostname setting in ntlm file doesn't affect remoting result

Steps:

  1. on the server client: vi /etc/opt/omi/.creds/ntlm and give a hostname which doesn't exist at all like 'wronghostname:root:password01'.
  2. on the client try to remote to this server with omicli command.

-u with hostname setting in ntlm file:
/opt/omi/bin/omicli id -u wronghostname\root -p 'password01' --auth NegoWithCreds --hostname psl-cent7x64-01 --port 5986 --encryption https

-u with username without hostname:
/opt/omi/bin/omicli id -u root -p 'password01' --auth NegoWithCreds --hostname psl-cent7x64-01 --port 5986 --encryption https

Expected:
The remote should fail.

Acutal Result:
Both remote connections succeed.

root@psl-cent7x64-02  #  /opt/omi/bin/omicli id  -u psl-cent7x64-0\\root -p 'password01' --auth NegoWithCreds --hostname psl-cent7x64-01 --port 5986 --encryption https
instance of OMI_Identify
{
    InstanceID=2FDB5542-5896-45D5-9BE9-DC04430AAABE
    SystemName=psl-cent7x64-01
    ProductName=OMI
    ProductVendor=Microsoft
    ProductVersionMajor=1
    ProductVersionMinor=2
    ProductVersionRevision=0
    ProductVersionString=1.2.0-35
    Platform=LINUX_X86_64_GNU
    OperatingSystem=LINUX
    Architecture=X86_64
    Compiler=GNU
    ConfigPrefix=GNU
    ConfigLibDir=/opt/omi/lib
    ConfigBinDir=/opt/omi/bin
    ConfigIncludeDir=/opt/omi/include
    ConfigDataDir=/opt/omi/share
    ConfigLocalStateDir=/var/opt/omi
    ConfigSysConfDir=/etc/opt/omi/conf
    ConfigProviderDir=/etc/opt/omi/conf
    ConfigLogFile=/var/opt/omi/log/omiserver.log
    ConfigPIDFile=/var/opt/omi/run/omiserver.pid
    ConfigRegisterDir=/etc/opt/omi/conf/omiregister
    ConfigSchemaDir=/opt/omi/share/omischema
    ConfigNameSpaces={root-omi, interop}
}

root@psl-cent7x64-02 # /opt/omi/bin/omicli id -u root -p 'password01' --auth NegoWithCreds --hostname psl-cent7x64-01 --port 5986 --encryption https
instance of OMI_Identify
{
InstanceID=2FDB5542-5896-45D5-9BE9-DC04430AAABE
SystemName=psl-cent7x64-01
ProductName=OMI
ProductVendor=Microsoft
ProductVersionMajor=1
ProductVersionMinor=2
ProductVersionRevision=0
ProductVersionString=1.2.0-35
Platform=LINUX_X86_64_GNU
OperatingSystem=LINUX
Architecture=X86_64
Compiler=GNU
ConfigPrefix=GNU
ConfigLibDir=/opt/omi/lib
ConfigBinDir=/opt/omi/bin
ConfigIncludeDir=/opt/omi/include
ConfigDataDir=/opt/omi/share
ConfigLocalStateDir=/var/opt/omi
ConfigSysConfDir=/etc/opt/omi/conf
ConfigProviderDir=/etc/opt/omi/conf
ConfigLogFile=/var/opt/omi/log/omiserver.log
ConfigPIDFile=/var/opt/omi/run/omiserver.pid
ConfigRegisterDir=/etc/opt/omi/conf/omiregister
ConfigSchemaDir=/opt/omi/share/omischema
ConfigNameSpaces={root-omi, interop}
}

Basic Auth over HTTPS from reports MI_RESULT_ACCESS_DENIED

With PowerShell version 6.1 preview and PSRP 1.4.2-2, attempting to create a new PSSession using Basic Authentication and -UseSSL reports error code 2 (MI_RESULT_ACCESS_DENIED)

Repro:
PS> $cred = Get-Credential username@hostname
PS> $session = New-PSSession -Computer -Credential $cred -Authentication Basic -UseSSL

Expected:
A PSSession is created.

Actual:
New-PSSession : [dantradesk] Connecting to remote server dantradesk failed with the following error message : Basic Authorization failed for user psrptest@dantradesk For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:12

  • $session = New-PSSession -ComputerName dantradesk -Credential $cred - ...
  •        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
  • CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
  • FullyQualifiedErrorId : 2,PSSessionOpenFailed

Build error on Raspbian

I have following build error on Raspian Stretch (32-bit Linux for Raspberry Pi):

/home/pi/psl-omi-provider/src/Shell.c: In function ‘Shell_CreateInstance’:
/home/pi/psl-omi-provider/src/Shell.c:956:67: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
         if (Stprintf(shellData->shellId, ID_LENGTH, MI_T("%llx"), (MI_Uint64) shellData) < 0)
                                                                   ^
/home/pi/psl-omi-provider/src/Shell.c: In function ‘Shell_Invoke_Command’:
/home/pi/psl-omi-provider/src/Shell.c:1362:67: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
         Stprintf(commandData->commandId, ID_LENGTH, MI_T("%llx"), (MI_Uint64)commandData);
                                                                   ^
cc1: all warnings being treated as errors
CMakeFiles/psrpomiprov.dir/build.make:62: recipe for target 'CMakeFiles/psrpomiprov.dir/Shell.c.o' failed
make[3]: *** [CMakeFiles/psrpomiprov.dir/Shell.c.o] Error 1

Is it possible to build for 32-bit Linux?

Copy-Item -ToSession from WIndows to Linux corrupts the transferred file

Having the following environment:

Linux OS is SLES 12-SP2 x86_64
tony@linux-31cz:~> /opt/omi/bin/omiserver -v
/opt/omi/bin/omiserver: OMI-1.5.0-0 - Mon Jul 23 09:07:48 PDT 2018
tony@linux-31cz:~> rpm -qa | grep psrp
omi-psrp-server-1.4.2-2.x86_64
tony@linux-31cz:~> rpm -qa | grep powershell
powershell-6.1.0-1.rhel.7.x86_64

On Windows 2016 with the default Powershell

PS C:\Users\Administrator.ADIDAS> $host


Name             : ConsoleHost
Version          : 5.1.14393.2155
InstanceId       : 4f6ce772-9aa7-46a4-9b2f-116d54cc1117
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

On Windows i create a remote powershell session to Linux SLES, and the Remote copy from Windows to Linux fails:

Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS C:\Users\Administrator.ADIDAS> $SecurePass = ConvertTo-SecureString -String "root-password" -AsPlainText -Force
PS C:\Users\Administrator.ADIDAS> $Cred = New-Object System.Management.Automation.PSCredential "root" , $SecurePass
PS C:\Users\Administrator.ADIDAS> $Opt = New-PSSessionOption -SkipCACheck -SkipRevocationCheck -SkipCNCheck
PS C:\Users\Administrator.ADIDAS> $Session = New-PsSession -Credential $Cred -ComputerName 11.0.0.21 -Port 5986 -Authentication Basic -SessionOption $Opt -UseSSL
PS C:\Users\Administrator.ADIDAS> Copy-Item -Path 'c:\package-8.1.7-0.x86_64.tar.gz' -Destination '/tmp/' -ToSession $Session -UseTransaction
>>
The provider does not support transactions. Perform the operation again without the -UseTransaction parameter.
At line:1 char:1
+ Copy-Item -Path 'c:\package-8.1.7-0.x86_64.tar.gz ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotImplemented: (:) [], PSNotSupportedException
    + FullyQualifiedErrorId : NotSupported

PS C:\Users\Administrator.ADIDAS> Copy-Item -Path 'c:\package-8.1.7-0.x86_64.tar.gz' -Destination '/tmp/' -ToSession $Session
PS C:\Users\Administrator.ADIDAS> Enter-PSSession $Session
[11.0.0.21]: PS /root> iex 'tar -tzf /tmp/package-8.1.7-0.x86_64.tar.gz'
opt/app/
opt/app/DE_DE/
opt/app/DE_DE/tdps.cat
opt/app/EN_US/
opt/app/EN_US/tdps.cat
opt/app/ES_ES/
opt/app/ES_ES/tdps.cat
opt/app/FR_FR/
opt/app/FR_FR/tdps.cat
opt/app/IT_IT/
opt/app/IT_IT/tdps.cat
opt/app/JA_JP/
opt/app/JA_JP/tdps.cat
opt/app/KO_KR/
opt/app/KO_KR/tdps.cat
opt/app/PT_BR/
opt/app/PT_BR/tdps.cat
opt/app/ZH_CN/
opt/app/ZH_CN/tdps.cat
opt/app/ZH_TW/
opt/app/ZH_TW/tdps.cat
opt/app/mssqlsmoapp_root/
opt/app/mssqlsmoapp_root/mssqlsmoapp.dll
opt/app/mssqlsmoapp_root/mssqlsmoapp.pdb
opt/app/mssqlsmoapp_root/Microsoft.Data.Tools.Sql.BatchParser.dll
opt/app/mssqlsmoapp_root/Microsoft.SqlServer.ConnectionInfo.dll
opt/app/mssqlsmoapp_root/Microsoft.SqlServer.Management.Dmf.dll
opt/app/mssqlsmoapp_root/Microsoft.SqlServer.Management.Sdk.Sfc.dll
opt/app/mssqlsmoapp_root/Microsoft.SqlServer.Smo.dll
opt/app/mssqlsmoapp_root/Microsoft.SqlServer.SmoExtended.dll
opt/app/mssqlsmoapp_root/Microsoft.SqlServer.SqlEnum.dll
opt/app/mssqlsmoapp_root/NetCoreGlobalization.dll
opt/app/mssqlsmoapp_root/Newtonsoft.Json.dll
opt/app/mssqlsmoapp_root/Microsoft.CSharp.dll
opt/app/mssqlsmoapp_root/Microsoft.VisualBasic.dll
/bin/tar: Skipping to next header
/bin/tar: A lone zero block at 20330
/bin/tar: Exiting with failure status due to previous errors
[11.0.0.21]: PS /root>

Disconnect-PSSession from Ubuntu16x64 to Cent7 will fail

$password=convertto-securestring "***" -asplaintext -force
$pscred=New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "root",$password
$session=New-PSSessionOption -SkipCACheck -SkipRevocationCheck -SkipCNCheck
New-PSSession -ComputerName "psl64-cent7-01" -Credential $pscred -Authentication Basic -UseSSL -SessionOption $session
Get-PSSession|Disconnect-PSSession
Disconnect-PSSession : Disconnect-PSSession operation failed for runspace Id = 
805f151a-97f0-4124-96fd-e9fa90d42270 for the following reason: The 
disconnection operation is not supported on the remote computer. To support 
disconnecting, the remote computer must be running Windows PowerShell 3.0 or a 
later version of Windows PowerShell.
At line:1 char:15
+ Get-PSSession|Disconnect-PSSession
+               ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: ([PSSession]WinRM1:PSSession)  
   [Disconnect-PSSession], RuntimeException
    + FullyQualifiedErrorId : PSSessionDisconnectFailed,Microsoft.PowerShell.C 
   ommands.DisconnectPSSessionCommand

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.