Sessions, Sessions, Sessions…

I did not have the possibility to visit eighter MMS or TechED North America this year but fortunately Microsoft makes all the sessions available for download. The problem is that it takes a lot of time to download the ones I want. So I tried to find a better way to do it and someone has written a script Smile

In the links below you will find the two scripts.


Hosted Exchange 2010 SP1

Håller just nu på att installera en Hosted Exchange 2010 lösning hos en kund och tänkte att jag skulle samla lite resurser och skriva ner lite instruktioner:

Powershell Snippets

Skapa en organisation

   1: Password = Read-Host "Enter Password" -AsSecureString

   2: New-organization -name TestOrg -DomainName -ProgramId HostingSample -OfferId 2 -location sv-SE -AdministratorPassword $Password

Radera alla mailboxar i en organisation

   1: get-mailbox -Organization TestOrg | remove-mailbox

Radera Organisation

   1: Remove-Organization TestOrg

Skapa användare i Organisation

   1: $OrgName = TestORG

   2: Import-CSV CreateRecipients.csv | foreach {new-mailbox $ -userPrincipalName $_.UPN -org $OrgName -Password (ConvertTo-SecureString $_.password -AsPlainText -Force)}

Vi läser filen CreateRecipients.csv och skapar användare i Organisationen. CreateRecipients.csv skall se ut så här:

   1: Name,UPN,Password

   2: Nisse Hult,,P@ssw0rd1

   3: Kalle Kula,,P@ssw0rd2

Lägg till mailadresser för en användare

   1: $user = Get-Mailbox -identity $args[0] -organization TestOrg

   2: $CLIARGS=$args[1..($args.length - 1)]

   3: ForEach ($CLIARG in $CLIARGS)

   4: {

   5: $user.emailAddresses+=$CLIARG

   6: }

   7: Set-Mailbox $user -emailAddresses $user.emailAddresses

Detta script lägger till extra mailadresser för en användare. Spara scriptet som AddEmail.ps1 och kör det enligt följande:

AddEmail.ps1 [primary email] [extra email 1] [extra email 2]…


Microsoft Exchange Server 2007 – Public Folders

Some powershell stuff on managing Public Folders in Exchange 2007

Create Public Folder

   New-PublicFolder -name "Name"

Remove a Public Folder

   Remove-PublicFolder -Identity "My Public Folder"

Get information on Public Folders

   Get-PublicFolder or Get-PublicFolder -Identity ""

Get information on all public folders

   Get-PublicFolder -Recurse | Format-List Name

get info on all system folders (not otherwise visible)

   Get-PublicFolder -Identity NON_IPM_SUBTREE -Recurse | Format-List Name 

What I need to find out:

– I could not find how to create a Contacts och Calendar Folder
– I could not find out how to change permissions on the root of the Public Folder tree
– I could not change the permission on the public folders


Microsoft Exchange Server 2007 – Connectors

I recently installed my first Exchange 2007 Server and I had problems with recieving mail and found it to be related to the recieve connector.

Exchange 2007 have two kinds of connector. Send connector and recieve connector.

The send connector is located on the Organisation Level and you need to create one for the servers to be able to send mail to internet.

The recieve connector is located in the server level. The Default Recieve Connector is automatically created.

Note: By default it is set up to only recieve mail from authenticated servers. This is a problem if the server is connected directly to the internet. To fix this open properties for the Default Connector and go to “Permission Groups” and click “Anonymous Users” or use Powershell:

   set-ReceiveConnector -identity “Name of Default Connector” -PermissionGroups AnonymousUsers


Scripting Exchange 2007

As you know Exchange 2007 can be totally administered by using Powerscript. Here I have tried to collect some scripts for Exchange 2007 administration:

Empty a mailbox database

List mailbox servers in an organisation


List maildatabases on current server


List mailboxes in maildatabase

   get-mailbox -database "Mailbox Database"

Disable a mailbox

   disable-mailbox [mailboxid]

Bulk enable mailboxes for AD users:

selects all users from AD

   get-user | where-object{$_.RecipientType –eq “User”}

Selects all users from the OU people

   get-user –organizationalUnit people | where-object{$_.RecipientType –eq “User”}
   get-user -organizationalUnit domain/OU/SUBOU | where-object{$_.RecipientType -eq "User"}

   Note: This will get you only users NOT users with mailboxes

Mailenable users from CSV file

   Import-CSV import.csv | foreach {enable-mailbox -Identity $_.Fullname -database EXCHSERVERMailbox Database"}

Where the importfile looks like this:

Firstname Lastname, Change Booking Policy for resources
Set-MailboxCalendarSettings -Identity "Resource Name" -BookingWindowInDays 520


Related Links

Microsoft Exchange Server 2007 Installation Issues

– Domain not in Windows 2000 native mode or Higher

   Solution: Raised Domain functional Level

– Domain Controller Pre Windows 2003

   Solution: Specified DC on install

   setup /mode:install / /roles:ht,ca,mb,mt /enablelegacyoutlook /Organizationname:Company

– Missing Patches for Powershell and .NET Framework


– You do not have permissions to read the security descriptor on CN=Deleted Objects,CN=Configuration,…

   Started installation from console instead of RDP Session


Common Mistakes When Upgrading Exchange 2000/2003 To a Exchange 2007
Google Groups
Jim McBee’s Mostly Exchange Web Log
HELO Windows Blog
Microsoft Technet Forum