Quantcast
Viewing all articles
Browse latest Browse all 197835

Re: powermt license check

Slight change, try it like this

 

$mask= [regex]"State\s*:\s(?<status>\w+?)\s"
$ExportFilePath="C:\HostNicInfo.csv"$PuttyUser="root"
$PuttyPwd="passwd123"
$hostlist="esx-test-120"$Plink="echo Y |C:\plink.exe"
$PlinkOptions=" -v -pw $PuttyPwd"
$cmd0="./opt/emc/powerpath/bin/powermt check_registration"
$Report
=@()$Message=""$HostInfo= {} |SelectHostName,State
$HostInfo
.HostName=$hostlist
Write-Host"Connecting to: "$hostlist-ForegroundColorGreen
$command=$Plink+" "+$PlinkOptions+" "+$PuttyUser+"@"+$hostlist+" "+$cmd0
$Message
=Invoke-Expression-command$command
$HostInfo
.State=$Message|Select-String-Pattern$mask|Select-ExpandPropertyMatches|%{$_.Groups["status"].Value}$Report+=$HostInfo
$Report|Export-Csv$ExportFilePath-NoTypeInformation

Viewing all articles
Browse latest Browse all 197835

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>