Body
Overview
If you've been granted access to manage your department's accounts for the Texas A&M Exchange Email accounts, it can be useful to connect your computer's instance of PowerShell to the Texas A&M Exchange Management servers. You will need to make sure you are using Exchange Online PowerShell V2 in order to connect using Modern Authentication and multifactor authentication.
Install Exchange Online PowerShell V2
The Exchange Online PowerShell V2 (EXO V2) module can be downloaded from https://www.powershellgallery.com/packages/ExchangeOnlineManagement/. The PowerShell Gallery page will include a link that you can copy and paste into your PowerShell session to download and install the EXO V2 module.
- Open PowerShell on your computer as an administrator. Make sure the title bar displays "Administrator: Windows PowerShell."
- Paste the installation command provided by https://www.powershellgallery.com/packages/ExchangeOnlineManagement/ and hit Enter.
Example: Install-Module -Name ExchangeOnlineManagement -RequiredVersion 2.0.5
- Enter Y if asked to import the NuGet provider.
- Enter Y to allow installation of the PowerShell Gallery repository.
Connecting to Exchange
- Open PowerShell on your computer as an administrator. Make sure the title bar displays "Administrator: Windows PowerShell."
- Click Yes to allow PowerShell to make changes to your device.
- Enter
Import-Module ExchangeOnlineManagement
.
- Enter
Connect-ExchangeOnline -UserPrincipalName NetID@tamu.edu
.
- Enter your NetID password and click Next.
- Authenticate via Duo.
Note: If you are already authenticated via Duo and your NetID, you may not be prompted for your NetID password and Duo authentication.
At this point, you will be connected to Exchange Online. A list of new Exchange Online cmdlets will be presented to you. These new cmdlets are optimized for Exchange Online and are typically faster and more reliable than the older equivalent cmdlets. Ex: Get-EXOMailbox
replaces the older Get-Mailbox
.
More Information
Additional information on Exchange Online PowerShell V2 can be found at Microsoft's documentation site.
Connecting to On-Premise Exchange
- Open PowerShell on your computer.
- Run the following command to open the session:
$Session = New-PSSession -Credential (Get-Credential) -ConfigurationName Microsoft.Exchange -Authentication Basic -URI https://exchange.tamu.edu/powershell
- Enter your NetID credentials in the format NetID@tamu.edu.
- Run the following command to import the server commands:
Import-PSSession -Session $Session -DisableNameChecking -AllowClobber
You should now be able to run PowerShell commands such as Get-DistributionGroup
or Get-MailboxPermission
on the Exchange Management Shell.