Powershell Script to Check Server Time

I am looking for a powershell script to check the time of the PDC and an external NTP server and then email the results to me. Trying to automate a few weekly tasks. Anyone have a script that they use?
Who is Participating?
Steven HarrisConnect With a Mentor PresidentCommented:
I have set up something similar for a customer using the following reference: Check Timesource (W32TM)

Pipe the output to an email using SMTP or just attach the file to an email, such as:

$file = "path to above output file"
$mailboxdata = (Get-MailboxStatistics | select DisplayName, TotalItemSize,TotalDeletedItemSize, ItemCount, LastLoggedOnUserAccount, LastLogonTime)
$mailboxdata | export-csv "$file"
$smtpServer = ""
$att = new-object Net.Mail.Attachment($file)
$msg = new-object Net.Mail.MailMessage
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$msg.From = "emailadmin@test.com"
$msg.Subject = "Notification from email server"
$msg.Body = "Attached is the email server mailbox report"

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.