Archive for Brian Higgins

Exchange 2007 Hosted Exchange Project

This script was part of a test project I was involved with back in 2009 setting up a hosted exchange environment.  The project was scrapped by the people paying the bills before it ever went live, partly because 2010 was about to come out, partly because they finally started to believe me about how much it was going to cost to do it right.  Either way these are the hosted client setup scripts that I built for creating new hosting clients as well as creating new users for those clients. Read more

Mail Disable Public Folders by Script

A customers sever turned out to have about 200 mail enabled public folders, where only a small handful needed to be mail enabled. The folders that needed to remain mail enabled were listed in the Switch statement, and all other folders were disabled by the script.

$PFList = Get-PublicFolder -Recurse

foreach($PF in $PFList) {

	$Folder = $

	$Process = Switch ($Folder)
	 #"IPM_SUBTREE" { $False }
	 "* Admin Inbox" { $False }
	 "* Sales Inbox" { $False }
	 "* Info Inbox" { $False }
	 "* Returns Inbox" { $False }
	 Default { $True }

    If ($Process -eq $True) {
        #write-host "Mail Disableing " $PF.Identity
        Disable-MailPublicFolder -Identity $PF.Identity -Confirm:$False


Bulk Public Folder Rename and Cleanup Script

While doing a migration to Exchange 2010 a few years ago I ran into a situation where lots of the public folders would not replicate from 2007 due to the inclusion of characters in the name that exchange doesn’t like, but outlook allows, including (and most difficult to troubleshoot) a trailing space in the name.

unfortunately this client had over 15,000 individual public folders they had created over years of time with data they couldn’t loose, with folder names including shipment dates (and the “/” that went along with it) and many other things. Read more

Bulk Import from GMail (or any IMAP server) to Exchange

This command appears to have been removed in 2013, but it’s one that is worth documenting anyway since it may be worth spinning up a 2007-2010 server to use it if you find yourself needing to migrate off that mistake someone previously made by moving everyone to Google apps, and back to Exchange.

CSV Columns:

Read more

Bulk script creation of users with custom passwords

This exchange script will import a CSV file with the following column names and create the user accounts, including a unique password for each user as defined by the CSV file.  Great for new environments where you have a list of users and their existing passwords.

CSV Columns:
uName, FirstName, LastName, UPN, Password

Read more

Bulk Rewrite of Display Name

A customer wanted to identify their employees by department when they were emailing people to ensure that people knew who they were dealing with, ex Sales, Finance, Legal Etc.

This script will import a CSV file with a list of existing usernames and prepend the title “Sales-” to their display name. Read more

Outlook 2013 Import NK2 file

This one isn’t PowerShell related, but it’s a common enough issue relating to Exchange that I wanted to post it anyway.

There are many posts showing up in a Google search that incorrectly report the path that Outlook looks at to import the NK2 file from.  The correct path is:


Once you move the NK2 file from the old machine to the new machine, from the run window (start -> run or Windows key + R) type in “outlook.exe /importnk2″ without the quotes and it will import the file and rename it to .old