Monthly Archives: July 2014

Connect to Office 365 using Windows Powershell

Open Windows Powershell and run the following commands:

$LiveCred = Get-Credential

Type your Office 365 administrator account and click ‘Ok’

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $LiveCred -Authentication Basic -AllowRedirection

Import-PSSession $Session

Exchange 2010 – Completely remove a mailbox

Whenever you delete a mailbox from Exchange 2010 the mailbox is not deleted completely from the server.
To remove the mailbox you have to execute the following commands:

Clean-MailboxDatabase "Mailbox Name"
When you now open Exchange Management Console and go to Recipient Configuration and then Disconnected Mailboxes you will see the the mailbox you just deleted there.
To now delete all mailboxes with the disconnected state you have to execute this command:
Get-MailboxStatistics -Database "Mailbox Name" | Where-Object {$_.DisconnectReason -eq "Disabled"} | ForEach {Remove-StoreMailbox -Database $_.database -identity $_.mailboxguid -MailboxState Disabled}

Windows 2008 R2 – How to install a Windows IIS server

In this ‘how to’ I will describe how to install a Windows 2008 R2 server with IIS.
I am using a Dell R210 II with a raid 1 configuration where I will install Windows 2008 R2 Enterprise edition (not needed).

After you’ve installed Windows2008 R2 make sure you download and install all the latest updates via Windows update.

After you installed all the updates we need to add the Webserver (IIS) role to the server.
Open the server manager (Start -> All Programs -> Administrative Tools -> Server Manager).
And go to Roles -> Add Roles -> Select Web Server (IIS) and click on Next.

On the select services screen select the services you wish to install.
In this example I will install the default checked options and I also check:
– Application Development, exclude ServerSide Includes
– FTP Server
Click Next and then Install.

Now when you go to http://localhost/ you should see the default page of IIS.