Sign in
|
Join PowerShell.com!
|
Help
Home
PowerTips
Ask the Experts
Forums
Webcasts
Blogs
eBookV2
Script Library
Twitter Grid
Modules
QuickClick
Scripts
Snippets
Videos
Library
»
Script Library
»
Networking
»
Slideshow
Networking Slideshow
Share
|
Browse Library
Module Library
QuickClick Library
Script Library
Active Directory
BizTalk
Citrix
Clustering
Desktop
Exchange Server 2003
Exchange Server 2007
File System
Group Policy
Internet Information Server (IIS)
Local Accounts
Logs
Microsoft Office
Microsoft Team Foundation Server
MySQL
Networking
Registry
Remote Desktop Services
Remoting
Security
SharePoint
SQL Server
System Center Virtual Machine Manager
System Center Configuration Manager
System Center Operations Manager
Tutorial
Terminal Server
Using .Net
Virtual Server
VMware
Windows 7
Windows HPC
Windows Server 2000
Windows Server 2003
Windows Server 2008
Windows XP
WMI
Misc
Snippet Library
Video Library
Members Only
Tags
Aman Dhally
Background Job
event viewer
Host
Hostname
IP
ip address
ipaddress
IPv4
IPv6
mail
Online
Parse
Ping
Ping Multiple Servers
PowerShell
powershell v2
range
Resolve
SMTP
System.Net.IPAddress
System.URI
test-connection
URL
validate
View more
Ping Multiple Server Using PowerShell and Email the Output - v2
#+-------------------------------------------------------------------+
#| = : = : = : = : = : = : = : = : = : = : = : = : = : = : = : = : = |
#|{>/-------------------------------------------------------------\<}|
#|: | Author:
Aman Dhally
| :|
#| :| Email:
amandhally@gmail.com
#|: | Purpose: Ping Multiple Servers / Computers
#|: |
Date: 15-Nov-2011
#| :|
/^(o.o)^\
Version: 1
|: |
#|{>\-------------------------------------------------------------/<}|
#| = : = : = : = : = : = : = : = : = : = : = : = : = : = : = : = : = |
#+-------------------------------------------------------------------+
#blog: http://newdelhipowershellusergroup.blogspot.in/2011/11/hi-today-i-was-looking-for-little.html
#### Provide the computer name in $computername variable
$ServerName
=
"localhost"
,
"Dc-XX"
$smtp
=
"ExchChange"
$to
=
"amandhally@gmail.com"
$from
=
"newdelhi@gmail.com"
$sub
=
" Server Status"
$body
=
@
"
"
@
##### Script Starts Here ######
foreach
(
$Server
in
$ServerName
) {
if
(
test-Connection
-ComputerName
$Server
-Count
2
-Quiet
) {
$body
+=
write-output
"$Server is alive and Pinging `n"
}
else
{
$body
+=
Write-output
"$Server seems dead not pinging `n"
}
}
$body
send-MailMessage
-SmtpServer
$smtp
-To
$to
-Subject
$sub
-Body
$body
-From
$from
########## end of script #######################
Loading...
Ping Multiple...
Release , Renew...
Average Ping...
Event Log Grabber...
Remote Admin...
Get-ComputerNameByIP
Analyze and...
New-IPRange
Utilities on...
Remote_Admin_Tools
View all files
Copyright 2011 PowerShell.com. All rights reserved.