How To: MS SQL Reseed or Reset Identity Column

Posted by SteveHardie | On: Jan 20 2013 | Comments (0)
DBCC CHECKIDENT can reseed (reset) the identity value of the table. For example, YourTable has 25 rows with 25 as last identity. If we want next record to have identity as 35 we need to run following T SQL script in Query Analyzer. DBCC CHECKIDENT ([YourTableName],...

Powershell: Delete File if Exists

Posted by SteveHardie | On: Sep 25 2012 | Comments (5)
Powershell script to delete a file if it already exists: If (Test-Path $strFileName){ Remove-Item $strFileName } See Also: Powershell: Check If File Exists Powershell: Delete Folder if Exists Test-Path Remove-Item

Exchange 2010: Set Work Hours for Room Mailbox

Posted by SteveHardie | On: Aug 16 2012 | Comments (2)
In Exchange 2010, when you create a room or resource mailbox, the Resource Policy tab gives you the option to Allow scheduling only during business hours. But what is business hours? The default business hours is from 8:00 am until 5:00 pm. You can check this by...

How To: Delete a mail profile from the registry

Posted by SteveHardie | On: Aug 10 2012 | Comments (0)
This is particularly handy if you want to reset your outlook profile, but the security policy on the computer does not allow you to launch the Mail control panel HKEY_USERS\\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles

How To: MS SQL Empty Database Log File

Posted by SteveHardie | On: Jul 15 2012 | Comments (0)
You will often find your database log file (.ldf) growing to a very large size, often larger than the databasie file (.mdf) itself. Log files should shrink after a full backup, but this isnt always the case. Below is a quick command you can run to empty a database...

How To: Configure External Time Source for Server 2008 R2

Posted by SteveHardie | On: Jul 15 2012 | Comments (7)
This article explains how to configure your Windows Server 2008 R2 Active Directory Primary Domain Controller to syncronise time with an external time source. Note: In an active directory, all member computers will sync time with the PDC, so you only need to setup...

Exchange 2010: Remove disconnected mailbox

Posted by SteveHardie | On: Jun 26 2012 | Comments (0)
After you delete a user from Acrive directory or Exchagne their mailbox is kept in the Exchange database for a number of days until it is automatiaccly removed. As defined in the “Limits” section of the database properties. If you want to force the...

Exchange 2010: Register custom functions in console

Posted by SteveHardie | On: Jun 26 2012 | Comments (0)
If you have defined custom functions in a .ps1 file, to register them in Exchange Command Shell all you need to do is run the following command: [ps] c:\Exchange> . .\.ps1 Then you can call your functions from the PowerShell command line.

Exchange 2010: Send on Behalf of a Distribution Group

Posted by SteveHardie | On: Jun 07 2012 | Comments (0)
When trying to send an email on behalf of a distribution group email address, you may get the following error: Your message did not reach some or all of the intended recipients. Subject: <Subject> Sent: 7/06/2012 10:55 AM The following...

SBS 2011: Can’t connect to the remote computer because no certificate was configured

Posted by SteveHardie | On: May 23 2012 | Comments (24)
Problem: When connecting to Windows SBS 2011 Remote Web Access, the following error appears when trying to connect to a remote computer.