profile for Hannel on Stack Exchange, a network of free, community-driven Q&A sites

Project Work Hours

Sat & Sun 6am - 9am

Subscribe via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Archives

MS Exchange

Includes everything Microsoft Exchange related

Thought i should start sharing some tools in my little tool box, this is my Exchange Start-Services script.

In my Lab at home the Virtual Machines are running minimal specs so i am always encountering issues with automatic Exchange services not starting at boot up so i came up a little script to solve that issue. The script can be manipulated to be used for any service or services.

Just 4 lines of ‘code’ and that’s it, script can be  run 30 minutes after server bootup as a scheduled task or on demand. Download script here

Syntax:

.\StartServices.ps1

Breakdown of script below

Continue reading

This video covers the end to end process of adding a new domain to an existing Exchange-O365 Environment.

It covers; SPAM Filter setup, External DNS, O365 Domain validation, Configure AD, Adding user in Exchange, DirSync, O365 Federation and more…

 

What happens when you are asked  to get an automate report from O365 with specific fields ASAP?

You task the system with a script like this

# Last Logon Time
# version 1.5
# Author: Hannel Hazeley | hhazeley@outlook.com

$timecode = get-date -format 'yyyyMMddHHmmss'

$MBXs = Get-Mailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited

Foreach ($MBX in $MBXs)
{
Get-Mailbox $MBX.Identity | Select UserPrincipalName, DisplayName, @{Name="FisrtName";Expression={(Get-msoluser -UserPrincipalName $_.UserPrincipalName).FirstName}}, @{Name="LastName";Expression={(Get-msoluser -UserPrincipalName $_.UserPrincipalName).LastName}}, @{Name="LastLogonDate";Expression={(Get-MailboxStatistics $_.Identity).LastLogonTime}} | Export-Csv "$timecode`_LastLogonTime.csv" -NoTypeInformation -Append
}

 

This will give you a CSV file containing UserPrincipalName, DisplayName, FirstName, LastName and LastLogOnTime for all user mailboxes. Run at your own risk. 🙂

20150710 - LLT

 

Happy Friday…. Enjoy!

 

 

As my Lab environment grows i am trying to streamline the process using ADFS to do all my authentication, below are the steps i used to setup Exchange 2013 to use ADFS for authentication

Prerequisite:

ADFS, a functioning ADFS system running
Exchange 2013, a functioning exchange system
Certificate, from a publicly trusted CA, this could be the same certificate you use for Exchange environment provided it has a SAN for ADFS environment.
Continue reading