Here are the basics. you will need plink, and also need to generate ssh keys with puttygen or something. have fun!
function plink { [CmdletBinding()] PARAM ( [Parameter(Mandatory=$True)] [ValidateNotNullOrEmpty()] [string] $remoteHost,
[Parameter(Mandatory=$True)] [ValidateNotNullOrEmpty()] [string] $ppk,
[Parameter(Mandatory=$True)] [ValidateNotNullOrEmpty()] [string] $command)
& .\plink.exe $remoteHost -i $ppk $command return }
$logfile = "logfile.txt" $remoteHost = "[user]@[array]" $ppk = "[private_key].ppk"
$command1 = "removevlun -f [volume_name] [LUN_ID] [Host or Set]" $command2 = "updatevv -ro -f [volume_name]" $command3 = "createvlun -f [volume_name] [LUN_ID] [Host or Set]"
try { plink $remoteHost $ppk $command1 } catch { "Error: $($_.Exception.Message)" >> $logfile [send an email or something] break }
try { plink $remoteHost $ppk $command2 } catch { "Error: $($_.Exception.Message)" >> $logfile [send an email or something] break }
try { plink $remoteHost $ppk $command3 } catch { "Error: $($_.Exception.Message)" >> $logfile [send an email or something] break }
|