Created
February 1, 2022 07:55
-
-
Save hunzo/e3259f84423e764199a30614c9abadd3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $User = "global_admin_account@domain.com" | |
| $PWord = ConvertTo-SecureString -String "global_admin_password" -AsPlainText -Force | |
| $cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, $PWord | |
| $exosession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid -Credential $cred -Authentication Basic -AllowRedirection | |
| Import-PSSession $exosession | |
| Get-Mailbox -Identity "email_users@domain.com" | select UserPrincipalName,ForwardingSmtpAddress,DeliverToMailboxAndForward |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment