Tuesday 17 August 2010

SBS 2008 Monitoring Database Maintenance

If you find that the SBSMONITORING instance of SQL Server is using up more than its fair share of resources (1.5GB+ RAM) and the
"SBSMonitoring.mdf" and "SBSMonitoring_log.LDF" files are over 4GB in size you need to run a maintenance script on the database and then shrink it.

SQL Server Express supports a maximum data file size of 4GB - once this limit is reached the SBS monitoring stops working.

To resolve this download this sql script:
http://cid-d5fe25afb6c3615f.skydrive.live.com/self.aspx/.Public/updateSBSMonitoring.sql

Run this script using:
Sqlcmd -S %computername%\SBSMonitoring -E  -i c:\path\to\updateSBSMonitoring.sql

If this runs successfully you should see:
Changed database context to 'SBSMonitoring'
(1 rows affected)

This can take a while to process (45min on a large database)

This will ensure that the database will contain no more than 90 days worth of data.

Source URL: http://blogs.technet.com/b/sbs/archive/2009/07/14/sbs-2008-console-may-take-too-long-to-display-alerts-and-security-statuses-display-not-available-or-crash.aspx

Next we need to shrink the database size:

Run the "SQL server management studio express
Ensure that "SERVERNAME\SBSMONITORING" is selected and "Windows Authentication" is used and click "Connect"
Expand Databases and find the SBSMonitoring, right click it and choose Tasks -> Shrink -> Database

This will run for a while (20min) after which the database size should reduce to a much smaller size (about 300MB or so in some cases)

Source URL: http://www.eggheadcafe.com/software/aspnet/35793646/sbs-monitoring-4gb-2008-now-what.aspx

Monday 16 August 2010

Copy TS client license

Source URL: http://support.microsoft.com/kb/323597


If we have a broken Terminal Server that cannot issue client licenses - causing RDP connection errors for new client PCs.

Export the "HKEY_LOCAL_MACHINE\Software\Microsoft\MSLicensing" key from a working machine on the network and import it onto the new client PC. This should resolve the RDP certificate issue and allow the client to connect.

NOTE: The real solution would be to resolve the TS Licensing issue - Restore the TS Licensing or re-activate the server using the TS CALs, etc.

Enable Quicklaunch toolbar and Clock for Terminal Server users


To enable the clock and Quicklaunch bar we need to make sure the following GPO are set as follows:

User Configuration > Administrative Templates > Start Menu and Taskbar
DISABLE: Do not display any custom toolbars in the taskbar (This allows the user to activate the QL bar and others if needed - does not turn it on)
DISABLE: Hide the notification area
ENABLE: Prevent changes to Taskbar and Start Menu Settings
DISABLE: Remove Clock from the system notification area (This setting allows user to turn the clock on - does not actually turn it on)

Right, from a GPO point of view the user should be able to see the QL bar and clock. However you may find that neither the clock nor the QL bar is displayed. To force them to be displayed we need to do the following:

Export the following registry key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2

You'll see a "Settings" value, which contains something like this:
28 00 00 00 ff ff ff ff 02 00 00 00 03 00 00 00 6d 00 00 00 20 00 00 00 00 00 00 00 e0 03 00 00 00 05 00 00 00 04 00 00

The nineth pair of digits determines the Taskbar properties. Possible values are:
Always on top = 0x02
Auto hide = 0x01
Show small icons in Start menu = 0x04
Hide clock = 0x08

Combine the properties you want and set the byte. For example:
Always on top + Show small icons + Show clock = 06
Always on top + Show small icons + Hide clock = 0e

Note that the changes do not take effect immediately, you have to restart Explorer, or logoff and logon again to see the changes.

I set it to 02 (Allways on top)

Save this to a .reg file in NETLOGON

Next for the QL bar:

Logon to admin and make sure the QL bar is active
Export the following key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop

to another .reg file in NETLOGON

Next we need to create a user LOGOFF script GPO and link it to the relevant user accounts. The script should push the required registry settings on logoff (we need explorer to be closed for the settings to remain as explorer updates these keys on closing and reads them only at startup)

The script should "regedit /s file.reg" the reg files created above this will add the keys silently.

The settings should apply the next time on user logon after the script as run.