Hi all
I have the following code
$CheckOut =Get-EventLog-ComputerNameNameofServer-LogNameSystem|where{$_.eventID-eq1074} |ft-AutoSize-Wrap|Out-String
$today = Get-Date -format d
Send-MailMessage -SmtpServerSMTPName-Toemailadress-Fromemailadress-subject"Reboots for $today"-Body$CheckOut
This will only do the server stored in NameOfServer. How do i change the code if i have a text file with servernames and the code must run for every name in the text file and output to the body of the email. Will appreciate any any help. Thanks in advance