Howdy!
I’ve recently stumbled across the job of looking for computers that we should know the location but don’t. So I’m looking to have these computer names in a text file, use get-content to ping each one until found, send ipinfo and logged on user to me via email and then remove the computer from the array, once the array count is zero, send me a final email
Are there any samples of this?
Essentially a very(very) cheap SCCM client
Thanks!!!
Ping Until Find
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Ping Until Find
Here is a simple template for doing this in a loop:
See:
help Get-Content -Online
help Test-Connection -Online
help Send-MailMessage -Online
Code: Select all
Get-Content servers.txt |
ForEach-Object{
Test-Connection $_
}
help Get-Content -Online
help Test-Connection -Online
help Send-MailMessage -Online