Solutions Through IT

May 8, 2012

SBS Monitoring Failure

Filed under: DRP (Disaster Recovery Planning), Microsoft, SBS, SBS 2008, SBS 2011 — solutionsthroughit @ 14:48

So I’ve jumped onto a server, and the monitoring had stopped functioning.  Corrupt database no less.  Having read up about this before, I whipped out a few trusty URLS.  They were in two places, plus I’ve added a twist at the end (which I believe is configured as part of the re-create step, but I’ve included it as it can cause problems).

Step one was here, to recreate the SBS Monitoring database and downloaded the Create-SBSMonitoringDB.zip file.  Extracted this, and fired up a powershell console, making sure I right-clicked and selected Run as Administrator.

If your system is default/secure, you’ll need to change your policy.  Ensure that you check the policy before you relax security, so that you can return it to the same setting.

image

Navigate to the directory you extracted the zip file, and execute the script.  This will recreate the database for you.

Once this is completed, I navigated over to here, to get a copy of the SQL to reduce the cleanup period, and create some indexes for performance.  I’ve taken the liberty of adding the last step, to ensure that the databse is in SIMPLE mode, reducing the SQL log file to the smallest size, on a system that is backed up correctly.

USE SBSMonitoring

UPDATE [SBSMonitoring].[dbo].[Settings] SET [Value] = 30 WHERE [Name] = 'CleanupPeriod'

EXECUTE [SBSMonitoring].[dbo].[CleanupDatabase]

CREATE NONCLUSTERED INDEX [_SBS_BLOG_index_WMICollectedData_5_K4_K1_K5_2] ON [dbo].[WMICollectedData] ([WMIPropertyID] ASC,[ID] ASC, [WMIInstanceID] ASC) INCLUDE ( [DateCollected]) WITH (SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF) ON [PRIMARY]

CREATE NONCLUSTERED INDEX [_SBS_BLOG_index_Reports_5_K2_K3_1_4] ON [dbo].[Reports] ([ConfigurationID] ASC, [DateGenerated] ASC) INCLUDE ([ID], [Data]) WITH (SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF) ON [PRIMARY]

CREATE NONCLUSTERED INDEX [_SBS_BLOG_index_WMICollectedData_5_K2D_K4_K5] ON [dbo].[WMICollectedData] ([DateCollected] DESC, [WMIPropertyID] ASC, [WMIInstanceID] ASC) WITH (SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF) ON [PRIMARY]

CREATE INDEX [_SBS_BLOG_index_Alerts_8_7_] ON [SBSMonitoring].[dbo].[Alerts] ([DefinitionID], [ComputerID]) INCLUDE ([DateOccured])

CREATE STATISTICS [_SBS_BLOG_stat_WMICollectedData_5_1_4] ON [dbo].[WMICollectedData]([WMIInstanceID], [ID], [WMIPropertyID])

CREATE STATISTICS [_SBS_BLOG_dta_stat_WMICollectedData_4_1_5_2_3] ON [dbo].[WMICollectedData]([WMIPropertyID], [ID], [WMIInstanceID], [DateCollected], [StatusID])

CREATE STATISTICS [_SBS_BLOG_dta_stat_WMICollectedData_5_1_3_4] ON [dbo].[WMICollectedData]([WMIInstanceID], [ID], [StatusID], [WMIPropertyID])

CREATE STATISTICS [_SBS_BLOG_dta_stat_WMICollectedData_5_4_2] ON [dbo].[WMICollectedData]([WMIInstanceID], [WMIPropertyID], [DateCollected])

CREATE STATISTICS [_SBS_BLOG_stat_WMICollectedData_2_1_5] ON [dbo].[WMICollectedData]([DateCollected], [ID], [WMIInstanceID])

CREATE STATISTICS [_SBS_BLOG_stat_WMICollectedData_1_3_5_2] ON [dbo].[WMICollectedData]([ID], [StatusID], [WMIInstanceID], [DateCollected])

ALTER DATABASE SBSMonitoring SET RECOVERY SIMPLE

Advertisements

April 11, 2012

I’ll take my email unfiltered, not cleaned.

Filed under: Anti-Spam, Exchange, Powershell, SBS 2008 — solutionsthroughit @ 09:39

I had an unusual request from a client – emails being sent to them were being filtered out by the anti-spam service.   Into the GUI I wander, looking for the recipient whitelist.  Alas, this wasn’t easily locatable, so I’ll whip out the trusty powershell – you can do ANYTHING with that ;)  (Start | All Programs | Microsoft Exchange Server 2007 | Exchange Management Console)

Set-ContentFilterConfig -BypassedRecipients sales@yourdomain.com,info@yourdomain.com

NOTE: THIS COMMAND WILL OVERWRITE ANY PREVIOUSLY SET FILTERED ADDRESSES

This will allow you to add one or more (comma separated) recipients to a white list, ensuring that these recipients get EVERY email sent to them, including all the junk and filth. To review, you can type

Get-ContentFilterConfig

To remove a single entry from this list should be achieved with the following statement

$foo=Get-ContentFilterConfig

$foo.BypassedRecipients -=”removeme@somedomain.com

$foo | Set-ContentFilterConfig

April 5, 2012

Powershell Play–Exporting mailboxes from an SBS Server (2008)

Filed under: Powershell, SBS, SBS 2008 — solutionsthroughit @ 12:42

I’m starting to have a play with powershell, as I’ve now got the requirements to start using it.  I’m impressed, I knew it was powerful, but as I hadn’t had a play yet, I’m still in “first looks” awe B)

I found this blog, which looked like it would happily help me export all my mailboxes, however, the export all mailboxes command was failing on my SBS 2008.

It was correct, the requirements for performing the export:

  • Outlook (32Bit version, 2003 or 2007).  I do not know if this will work with 2010.
  • Exchange 2007 Management Tools (Download the appropriate version from here)

I had to add permissions  to all accounts to the administrator account I was exporting with, so the following command added those permissions, substituting YourAdminUsername with your Admin username (surprisingly enough).

Get-Mailbox | Add-MailboxPermission –user YourAdminUsername –AccessRight FullAccess –Inheritancetype all

This command

Get-User | where { $_.Title –like “*” } | Export-Mailbox –PSTFolderPath C:\MyPSTExport

worked, but had a good number of errors, as it returned ALL accounts, whether or not they had a mailbox.  A better use for this specific case is where you want to export some  This command

Get-User | where { $_.RecipientType –like “UserMailbox” } | Export-Mailbox –PSTFolderPath C:\MyPSTExport

did the job perfectly.  This filtered only the users with mailboxes, and exported their contents.

Hopefully, I won’t have to be doing a bulk import, so won’t do a direct follow up to this 🙂

Update: Still looking for a “refresh PST” option, but have got a filter, that will allow exporting any changes, after a date – adding –StartDate YYYY/MM/DD as the last argument of the Export-Mailbox command, will allow you to export mail items created or MODIFIED after this date.

August 11, 2011

SBS 2008 – Exchange services fail to start on reboot.

Filed under: SBS, SBS 2008 — solutionsthroughit @ 17:05

Had this issue on a few SBS servers now, and have found a great KB article that resolves the issue correctly.  The problem is that some Exchange services attempt to start before AD has properly started. 

The official cause is “This problem occurs because the domain controller and other Exchange-Server-dependent services do not start completely when Exchange Server 2007 or Exchange Server 2010 try to start.

The Microsoft “Fix it for me” service works perfectly for this issue, if it’s the actual problem.

June 15, 2011

Windows Server 2008 DNS Servers may fail to resolve queries for some top-level domains

Filed under: SBS 2008, Server 2008 — solutionsthroughit @ 12:34

SBS 08, Server 08 will not process DNS requests correctly typically after a day or more.  Some DNS resolution will work, however some top level domains (.co.uk, .cn, .br etc) will not work.  This link should resolve this issue.  Essentially, the fix is:

1.    Start Registry Editor (regedit.exe).
2.    Locate the following registry key:
3.    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DNS\Parameters
4.    On the Edit menu, click New, click DWORD (32-bit) Value, and then add the following value:
Value: MaxCacheTTL
Data Type: DWORD
Data value: 0x2A300 (172800 seconds in decimal, or 2 days)
5.    Click OK.
6.    Quit Registry Editor.
7.    Restart the DNS Server service.

February 16, 2011

Windows Server 2008 DNS Servers may fail to resolve queries for some top-level domains

Filed under: DNS, SBS 2008, Server 2008 — solutionsthroughit @ 08:22

SBS 08, Server 08 will not process DNS requests correctly typically after a day or more.  Some DNS resolution will work, however some top level domains (.co.uk, .cn, .br etc) will not work.  This link should resolve this issue.  Essentially, the fix is:

1.    Start Registry Editor (regedit.exe).
2.    Locate the following registry key:
3.    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DNS\Parameters
4.    On the Edit menu, click New, click DWORD (32-bit) Value, and then add the following value:
Value: MaxCacheTTL
Data Type: DWORD
Data value: 0x2A300 (172800 seconds in decimal, or 2 days)
5.    Click OK.
6.    Quit Registry Editor.
7.    Restart the DNS Server service.

Create a free website or blog at WordPress.com.