Manage Windows Hosts from Linux

Source: Internet
Author: User

Using Powershell


    • Configurations on the Windows Host

On the target with Windows system, configure the WinRM server to accept Basic authentication and allow unencrypted traffic .

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

WinRM set Winrm/config/service/auth @{basic= "true"}

To enable unencrypted communication-over HTTP on Windows in a administrative command prompt you must also run:

WinRM set Winrm/config/service @{allowunencrypted= "true"}


Note These commands is run in CMD, not PowerShell.

Basic authentication with WinRM can only access local machine accounts so you'll need to use a local account on your Win Dows machine, which is part of the Administrator group, with our test environment, you can use administrator.


    • Configurations on the Linux Host

On the host with Linux System, install PowerShell and set the environment variable, then run PowerShell to connect target System.

1. Install PowerShell

Download the RPM installer, then run:

Rpm-i powershell-xxx.rpm

If the system asks for dependency packages, please use Yum or apt-get to install them.

2. Set the environment variable

echo "Export Ld_library_path=psl-omi-provider-path/src:psl-omi-provider-path/omi/unix/output/lib:${ld_library_ PATH} ">>/etc/profile

Source/etc/profile

3. Run PowerShell to connect to target system

[[email protected] ~]# PowerShell

PowerShell

Copyright (C) Microsoft Corporation. All rights reserved.

ps/root> $IP = "192.168.xx.xx" (this is the IP of Windows host)

ps/root> $cred =get-credential

Windows PowerShell Credential Request

Enter your credentials.

User:administrator

Password for User administrator: ******** (This is interactive, you need to enter the user name, password on Windows host)

ps/root> enter-pssession-computername $IP-credential $cred-authentication Basic

[10.239.56.110]: PS c:\users\administrator\documents> ipconfig


Reference:

Https://github.com/PowerShell/PowerShell

Https://github.com/Microsoft/omi/blob/master/Unix/doc/setup-ntlm-omi.md


Using SSH

would update later.

Manage Windows Hosts from Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.