Skip to content

Instantly share code, notes, and snippets.

@BustedSec BustedSec/ps1
Created Nov 3, 2015

Embed
What would you like to do?
Check for missing network shares
$bod = "Please investigate"
$Computers = Get-Content 'e:\scripts\servers.txt'
Foreach ($PCname in $Computers)
{
if (test-path $pcname)
{$Pcname}
else
{Send-MailMessage -SmtpServer autodiscover.ecinfosystems.com -From my@email.com -To emailaddress@emailplace.com -Subject "$PCname missing network shares" -Body $bod}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.