November 2018
Intermediate to advanced
566 pages
17h 15m
English
Here's the script that will send the email message:
# inputfile - filelocation of the CSV file$inputfile='/tmp/input.CSV'# Output file $outfile='/tmp/out.html'#Email variable declaration$from = 'donotreply@packtpublinux.com'$to = 'pjayaram@gmail.com'$cc = 'pjayaram@gmail.com'$sub = 'Process Info-PowerShell Remoting'$body = 'PowerShell script automation email to pull process related information from Windows and Linux machines'$attachment = $outfile$smtpserver = 'packpublinux@smtp.com'#declare the array to hold multiple values$Top = @()#the output of import-csv is assigned to a variable$process =Import-Csv $inputfile|% { Invoke-Command -HostName $_.Server -UserName ...
Read now
Unlock full access