-
-
Save BustedSec/13fd706e2451bdf68f9a to your computer and use it in GitHub Desktop.
Check for missing network shares
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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 [email protected] -To [email protected] -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