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

April 13, 2012 at 4:40 pm | Posted in Administration, Installation, Performance, PowerShell | 2 Comments
Tags: , , , ,

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

Advertisements

2 Comments »

RSS feed for comments on this post. TrackBack URI

  1. Hi there, I would like to subscribe for this web site to obtain most up-to-date
    updates, thus where can i do it please help.

    • 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


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.
Entries and comments feeds.

%d bloggers like this: