plink powershell

Published: 24 June 2016
on channel: Linux Operating System
11K
2

How to running linux commands from powershell
My Blog:
Facebook:
Google+:

Example 1: How to create multiple user in linux, How to running linux commands from powershell.

Read data.txt file with structure the below.
Use powershell the connect to linux.
Create multiple user in linux.
---------------------------------------------------------
Code blocks
$plinkPath = "C:Usershuupv1DesktopSCRIPTplink.exe"
If (Test-Path $plinkPath) {
Set-Alias plink $plinkPath
}
Else {
Throw "PLink.exe is required"
}
$lines = Get-Content data.txt
foreach ($line in $lines) {
$fields = $line -split 's+'
foreach ($h in $fields) {
$h
$commands =
"echo 123456789 | sudo -S useradd " + $h + ";"
)
plink -ssh -pw "123456789" -t "192.168.1.112" -l "huupv" $commands
}
}
-----------------------------------------------------------


Watch video plink powershell online without registration, duration 03 minute 56 second in high hd quality. This video was added by user Linux Operating System 24 June 2016, don't forget to share it with your friends and acquaintances, it has been viewed on our site 11 thousand once and liked it 2 people.