Skip to content

Instantly share code, notes, and snippets.

@BustedSec
Created November 3, 2015 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BustedSec/13fd706e2451bdf68f9a to your computer and use it in GitHub Desktop.
Save BustedSec/13fd706e2451bdf68f9a to your computer and use it in GitHub Desktop.
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