Check server times for #SharePoint / #ProjectServer farms #PS2010 #SP2010 #MSProject #PowerShell

For a server farm it is important that all server times are in sync, for Project Server this is key. For example if the Application server has a different time to the SQL server you might see jobs in the Project Server queue that are in sleeping state. A useful PowerShell script to check all of the server times in the SharePoint farm can be seen below:

The script can be downloaded from the script center here:

http://gallery.technet.microsoft.com/scriptcenter/Check-server-time-for-all-76fdd4c0

#Script needs to be run on a SharePoint server
#Run script with account that has admin access to all servers
Add-PSSnapin Microsoft.SharePoint.PowerShell -EA 0
$servers = (Get-SPServer) | foreach {$_.Address}

foreach($server in $servers)
{

$time = Get-WmiObject Win32_LocalTime -computer $server  -EA 0

$hour = $time.Hour
$minute = $time.Minute
$second = $time.Second
Write-Host “$server current time is $hour : $minute : $second”

}
Write-host “If the server times are not in sync please adjust the time settings. Press any key to continue”
$null = $host.UI.RawUI.ReadKey(“NoEcho,IncludeKeyDown”)

An example output can be seen below:

image

2 thoughts on “Check server times for #SharePoint / #ProjectServer farms #PS2010 #SP2010 #MSProject #PowerShell

    1. Hi there,

      On the right hand side of the homepage / any page below the tags and author details you will see a heading “Follow blog via email”.

      Thanks
      Paul

Comments are closed.

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: