SQL Server – How to Truncate Logs (.LDF) file.

The simple straight forward method to truncate logs in the occasion where you find yourself running out of disk space and do not have additional free space to spare.

Open SQL Studio > Select the database in question > Right click and Select Properties

From the Database Properties Window select Option and change the Recovery model to Simple.


Select OK

Then Right click the database and select Tasks > Shrink > Files. Change the File Type to Log > Select OK

This will truncate the .ldf file.

Exchange Server 2010 – Removing a Public Folder Replica

Microsoft has provided scripts to help with Public Folder management, in the event you need to remove a Public Folder Database from replication to the scripts directory of your installation path for Exchange.

Example: C:\Program File\Microsoft\Exchange Server\V14\scripts

Run the following:

.\RemoveReplicaFromPFRecursive.ps1 -TopPublicFolder “\” -ServerToRemove “NameofYourMailboxServer”

This will take some time to replicate. Once complete run the follow command to verify that all Public Folder replicas have been removed from this Public Folder Database.

Get-PublicFolder -Recurse | ft Name,ParentPath,Replicas

The replica for the given Public Folder Database should be removed. You can then proceed with removing the Public Folder Database.

Remove-PublicFolderDatabase “Name of your “PublicFolderDatabase”

Exchange Server 2016 – Remote Connection via Powershell (Windows 10)

On your remote machine open Powershell – Populate a variable with the credentials you will use to connect to your Exchange server2018-07-16_12-02-552018-07-16_12-05-07

Next type the following command to create a new session with the given credentials

$session = New-Pssession -ConfigurationName Microsoft.Exchange -connnectionuri http://yourservernameFQDN/powershell -authentication Kerberos -credential $credentials

Once this command is complete import the Exchange Powershell module to your machine using the following command.

Import-Pssession $session


Exchange Server 2010 – Unable to Remove Public Folder Database

When attempting to remove a Public Folder Database in Exchange 2010 you receive the following error message below: MapiExceptionMdbOffline: Unable to determine if the store has local replicas (hr=0x80004005, ec=1142).


In my case this Public Folder Database was only a replica on a mailbox server which we had set to decommission. I was unable to mount or remove this PF Database via Powershell or EMC.

One method is to remove the Public Folder Database with ADSIEdit. First, take a backup of your Active Directory environment. Then open ADSIEdit from your primary DC and go to the following location. Configuration: CN=Configuration, DC=domain, DC=com; CN=Services; CN=Microsoft Exchange; CN= Domain name; CN=Administrative Groups; CN=Exchange Administrative Group; CN=Databases; CN=PublicFolderDatabaseName

After removing the Public Folder Database restart the Information Store, the Public Folder Database will be removed.