Category Archives: Windows Server 2008

Powershell Script to Determine Active User Count for Microsoft Exchange 2010 and Exchange 2007

A script that I came up with to determine the user load that is being placed on a particular Exchange server so that you can plot the days of the week and times of the day that are busiest. This Powershell Script can be used with GFI Max Remote Management or SpiceWorks to easily identify busy Exchange servers.

$GETMSEXCHISAUC = Get-Counter ‘\MSExchangeIS\Active User Count’
$MSEXCHISAUC = $GETMSEXCHISAUC.CounterSamples |Select-Object CookedValue
Write-Host You have $MSEXCHISAUC.CookedValue Active Exchange User Connection\s to the Exchange Server

Feel free to edit the text part of the output (Last line), this could be simplified if required.

Powershell Script to Determine Number of Connections to your Microsoft Terminal Services Gateway

I’ve put together another script that might be useful for monitoring how busy your Terminal Services Gateway is at various times of the day.  This Powershell Script can be used with GFI Max Remote Management or SpiceWorks to easily identify busy servers.

$GETTSGWCC = Get-Counter ‘\Terminal Service Gateway\Current connections’
$TSGWCC = $GETTSGWCC.CounterSamples |Select-Object CookedValue
Write-Host You have $TSGWCC.CookedValue Current Connection\s to the Terminal Services Gateway

Feel free to edit the text part of the output (Last line), this could be reduced/simplified if required.

Fujitsu Primergy Servers – SNMP RAID and Server Health Checks

This next post is very useful for owners of Fujitsu or Fujitsu Siemens Primergy Servers, it highlights how you can monitor the status of your servers general Health and RAID Status.  To utilise these checks you will need to have the Windows SNMP Service installed and configured.  You will also need to download and install the Fujitsu ServerView RAID Manager and the Fujitsu ServerView Agent for Windows.

These OIDs can be used with your existing Server Monitoring Software such as GFI Max Remote Management or Spiceworks to provide upto the minute information.

Logical Drive Status (Array 1) = 1.3.6.1.4.1.231.2.49.1.6.2.1.10.1.1

1 = unknown, 2 = ok, 3 = degraded, 4 = offline, 5 = rebuilding, 6 = verifying, 7 = initializing, 8 = morphing, 9 = partially degraded

Logical Drive Status (Array 2) = 1.3.6.1.4.1.231.2.49.1.6.2.1.10.1.2

1 = unknown, 2 = ok, 3 = degraded, 4 = offline, 5 = rebuilding, 6 = verifying, 7 = initializing, 8 = morphing, 9 = partially degraded

If you have more than two Logical Drives (i.e. 4 x RAID 1 Sets) then simply substitute the last number of the above OID with 3 or 4, etc to reference the next Logical Drive

Number of Logical Drives = 1.3.6.1.4.1.231.2.49.1.6.1.0

1 = 1 Logical Drive, 2 = 2 Locagical Drives, 3 = 3 Locagical Drives, etc

Number of Physical Drives = 1.3.6.1.4.1.231.2.49.1.5.1.0

1 = 1 Physical Drive, 2 = 2 Physical Drives, 3 = 3 Physical Drives, etc

Power Supply Status = 1.3.6.1.4.1.231.2.10.2.2.5.11.1.1.2.0

1 = unknown, 2 = ok, 3 = degraded, 4 = critical

Temperature Sensor Ambient = 1.3.6.1.4.1.231.2.10.2.2.5.2.1.1.3.0.11

1 = unknown, 2 = sensor-disabled, 3 = ok, 4 = sensor-fail, 5 = warning-temp-warm, 6 = warning-temp-cold, 7 = critical-temp-warm, 8 = critical-temp-cold, 9 = damage-temp-warm

Temperature Sensor CPU (1) = 1.3.6.1.4.1.231.2.10.2.2.5.2.1.1.3.0.1

1 = unknown, 2 = sensor-disabled, 3 = ok, 4 = sensor-fail, 5 = warning-temp-warm, 6 = warning-temp-cold, 7 = critical-temp-warm, 8 = critical-temp-cold, 9 = damage-temp-warm

Temperature Sensor CPU (2) = 1.3.6.1.4.1.231.2.10.2.2.5.2.1.1.3.0.2

1 = unknown, 2 = sensor-disabled, 3 = ok, 4 = sensor-fail, 5 = warning-temp-warm, 6 = warning-temp-cold, 7 = critical-temp-warm, 8 = critical-temp-cold, 9 = damage-temp-warm

Please feel free to comment if you have any other useful OIDs or require further assistance

Improve Windows Performance by Enabling SATA AHCI Mode

Probably the biggest bottleneck in most computers these days is the hard disk drive and its interface (SATA).  Depending on the current configuration of your system it may be possible to further improve performance by turning on SATA AHCI mode in your system BIOS and ensuring that your Operating System has support for AHCI enabled.

Here is a brief guide to verify if AHCI is already enabled and if not to ensure that AHCI can be enabled and will work correctly.

Restart your computer and wait for the BIOS Screen to appear, you will need to enter your BIOS Setup Screen.  The Key to enter the BIOS Screen can vary between systems,  “Delete”, “F1”, “F2” or “F10” are some of the most common shortcuts.

Once in the BIOS Screen locate the SATA Controller options and check if the SATA mode is “AHCI”, “Compatible” or “IDE”. The “Compatible” and “IDE” options are usually selected when you are using a Legacy Operating System that does not have native AHCI and/or SATA support.  The trade off with these modes is that the operating system is unlikely to be able to take full advantage of all the features of your SATA Hard Disk to improve system performance.

If you find that your system is set to “Compatible” or “IDE” mode then don’t change anything just yet.  First we need to make sure that your Windows Operating System has AHCI support installed and active so lets exit the BIOS without making any changes and boot back into Windows.

Once you are back in Windows click on the “Start Menu” and then in the “Run” or “Search” box you need to type “regedit.exe”

You will need to locate the following two registry keys

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Msahci
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\IastorV

Under both of the listed registry keys above you will find multiple values, amongst these you will find a “REG_DWORD” value called “Start” and these both need to be changed from “0” to “1” to tell Windows that we want these additional AHCI controller drivers to be loaded at startup.

You may ask yourself why these are not enabled by default, Windows actually disables any unused drivers to speed up the Windows Startup process.  In this instance we just need to turn these two back on to accomplish our ultimate goal.

Now that we have AHCI support enabled within Windows lets reboot the computer once for these Registry changes to take full effect and to give Windows a chance to initialise the AHCI drivers.

The final set of this process is to restart the computer one last time and enter the BIOS screen again by using the process above.  Once in the BIOS locate the SATA Controller options and change the SATA mode to “AHCI”.  Remember to select “Save Changes and Exit” so that everything takes effect.

You should now find that the system boots back into Windows, the first boot may be a little slower than usual while the operating system re-detects your Hard Disk Drive.  Subsequent startups should be significantly faster.

If you have any issues booting back into Windows after making the switch to “AHCI” then simply go back to the BIOS and revert your SATA mode to its previous state and you will find Windows boots as before.