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

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

Just a little script I put together during the week to update primary email address on a user account that is been synced over to Office 365 (O365) from Active Directory (AD).  It’s not in any way a perfect script but gets the work done. Download script here

Syntax:

.\UpdatePE.ps1 -NewDomain azure.hazelnest.com -Address hhazeley@o365.hazelnest.com -KeepCurrentPrimary
.\UpdatePE.ps1 -NewDomain azure.hazelnest.com -KeepCurrentPrimary
.\UpdatePE.ps1 -NewDomain azure.hazelnest.com 
.\UpdatePE.ps1 -NewDomain azure.hazelnest.com -Address hhazeley@o365.hazelnest.com

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!