Category: Powershell-Scripts

Send-SMTPmail Using Powercli

Below function should be include in the script: function Send-SMTPmail($to, $from, $subject, $smtpserver, $body, $attachment) {$mailer = new-object Net.Mail.SMTPclient($smtpserver)$msg = new-object Net.Mail.MailMessage($from,$to,$subject,$body)$msg.IsBodyHTML = $true$attachment = new-object Net.Mail.Attachment($attachment)$msg.attachments.add($attachment)$mailer.send($msg)} Command which...

Read More

VIM Report

param( [string] $VIServer ) if ($VIServer -eq “”){Write-HostWrite-Host “Please specify a VI Server name eg….”Write-Host ” powershell.exe Report.ps1 MYVISERVER”Write-HostWrite-Hostexit} function PreReq{if ((Test-Path REGISTRY::HKEY_CLASSES_ROOTWord.Application) -eq $False){Write-Host “This script directly outputs...

Read More