Most IT admins know what a pain it is to set up Active Directory user accounts, especially when you need to setup a corresponding 365 mailbox.
Hopefully, this script is going to help you!
I’m going to guide you though using Powershell to create an Active Directory account, with a licenced Office 365 mailbox (in a hybrid Exchange 2013 environment).
I’m assuming you’re executing this script from an Admin Powershell prompt, on a Domain joined PC (It maybe useful for you to run this script in Powershell ISE).
This script will:
- Create an Active Directory user account + allow you to assign a user password (securely).
- Complete AD account details such as telephone number and address (useful if you are using my email signature script guide).
- Create an Office 365 mailbox (this script assumes that you are running in Exchange hybrid mode (i.e. your business also has an on Premise Exchange server).
- Turn on litigation hold enabled (for this to work, you will need the correct licences, ie: E3).
- Assign a 365 licence (I’m also assigning an ATP licence, Windows 10 licence and PowerBI standard licence).