Get-Mailbox <mail address or alias> | select-object WhenCreatedUTC, Name
Category: PowerShell
Remove EOL Automapping
Automapping is an Exchange & Exchange Online feature which automatically opens mailboxes with Full Access permissions in a delegate’s Outlook client.
Remove the access permissions. This also removes automapping.
Logon to Azure EOL (with MFA)
Business@contoso.ie is the mailbox being shared.
anna.grimm@contoso.ie is the account that has the access rights.
In EOL PowerShell
Remove-MailboxPermission -Identity “Business@contoso.ie” -User “anna.grimm@contoso.ie” -AccessRights FullAccess
Confirm
Are you sure you want to perform this action?
Removing mailbox permission Identity:”Business@contoso.ie” for user “anna.grimm@contoso.ie” with access rights “‘FullAccess'”.
[Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is “Y”): select A
You might get this error
WARNING
Can’t remove the access control entry on the object “User” for the user account because the ACE doesn’t exist on the object.
So use
Remove-MailboxPermission -Identity “Business@contoso.ie” -User “anna.grimm@contoso.ie” -AccessRights FullAccess –Confirm:$false –BypassMasterAccountSid
Re-add the permissions but without Automapping
Add-MailboxPermission -Identity “Business@comtoso.ie” -User “anna.grimm@contoso.ie” -AccessRights FullAccess -AutoMapping:$false
Use EOL PowerShell with MFA
Import-Module -Name ExchangeOnlineManagement
Connect-ExchangeOnline -UserPrincipalName <Azure admin account UPN>
This brings up a small logon web window. Input the password and select the MFA authentication method. On success PowerShell will finishing connecting to EOL.
Mailbox Rules
Get rules list
Get-InboxRule -Mailbox <mailbox name or alias>
Get detail on each rule
Get-InboxRule -Mailbox <mailbox name or alias> -Identity “<rule name>” | Select -Property *
Disable Rule
Disable-Inboxrule -identity “<Rule name>” -mailbox <mailbox name or alias>
Remove Rule
Remove-Inboxrule -identity <Rule Name> -mailbox <mailbox name or alias>
Get All Shared mailboxes permissions
Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize:Unlimited | Get-MailboxPermission | select identity,user,accessrights | where { ($_.User -like ‘@‘) } | Export-Csv -path C:\temp\Shared.csv -NoTypeInformation
EMS Not working
Sometimes an Exchange server installation goes bad and EMS will not launch from the Start Menu. This post helps to get a local EMS when you start to cleanup or want put things right.
Run these 2 commands in order on the Exchange server
exshell.psc1
exchange.ps1
Search a user’s mailbox for meetings
Search-Mailbox -identity Jbloggs@contoso.com -SearchQuery ‘Kind:meetings AND From:peter@xyz.com AND Subject:”Managers Monthly Meeting”‘ -TargetMailbox myaddress@contoso.com -TargetFolder ExchangeSearches -LogLevel full
Assign full permissions for a user to another users calendar
Set “Out of Office” on Mailbox with PowerShell
Dates are 6th April 2021 to 7th April 2021 and are always in American format (mm/dd/yyyy)
Uses email address
Set-MailboxAutoReplyConfiguration -identity mary.raymond@XYZ.com -AutoReplyState scheduled -starttime “04/06/2021” -endtime “04/07/2021 08:00:00” -ExternalAudience all -InternalMessage $message -ExternalMessage $message
Set-MailboxAutoReplyConfiguration -identity Emma.johnson@xyz.co.uk -AutoReplyState scheduled -starttime “04/06/2021” -endtime “04/07/2021” -ExternalAudience all -InternalMessage “I am currently out the office and will be returning on 7th April 2021.” -ExternalMessage “I am currently out the office and will be returning on 7th April 2021.”
Uses mail alias
Set-MailboxAutoReplyConfiguration <alias> -AutoReplyState enabled -ExternalAudience all -InternalMessage “This email address is no longer in use. Please email jimmy.parker@XYZ.com, Thanks” -ExternalMessage “This email address is no longer in use. Please email jimmy.parker@XYZ.com, Thanks”
Set-MailboxAutoReplyConfiguration <alias> -AutoReplyState scheduled -starttime “04/06/2021” -endtime “04/07/2021” -ExternalAudience all -InternalMessage “I’m currently out of the office and this mailbox is not being monitored. If you have any queries which need responding to please contact my manager Mark Mende by email mark.mende@xyz.co.uk” -ExternalMessage “I’m currently out of the office and this mailbox is not being monitored. If you have any queries which need responding to please contact my manager Mark Bloggs by email mark.bloggs@xyz.co.uk”
If part of the message has a $ sign – Use single quotes instead of double quotes
Set-MailboxAutoReplyConfiguration -identity risk@xyz.com -AutoReplyState enabled -ExternalAudience all -InternalMessage ‘Thank you for your mail. Please note that this is an unmonitored mail box. Please redirect your mail to $Risk@xyz.com‘ -ExternalMessage ‘Thank you for your mail. Please note that this is an unmonitored mail box. Please redirect your mail to $Risk@xyz.com‘
To check your results afterwards:
Get-MailboxAutoReplyConfiguration –Identity servicing@xyz.co.uk
To turn off auto-replies
Set-MailboxAutoReplyConfiguration -Identity <alias or email> -AutoReplyState disabled
To turn off auto-replies and clear the reply text
Set-MailboxAutoReplyConfiguration <alias or email> –AutoReplyState Disabled –ExternalMessage $null –InternalMessage $null
HTML Multiline Message, use <br> tags for line breaks
Set-MailboxAutoReplyConfiguration -identity <alias or email> -AutoReplyState enabled -ExternalAudience all -InternalMessage “This mailbox is currently closed and is not monitored.<br><br>Please contact the Service Desk using your company’s number below..<br><br>XYZ Europe: +01 123 456 7890 <br><br>Alternatively please log your issue on Service Desk Online through your company Intranet.” -ExternalMessage “”This mailbox is currently closed and is not monitored.<br><br>Please contact the Service Desk using your company’s number below..<br><br>XYZ Europe: +01 123 456 7890 <br><br>Alternatively please log your issue on Service Desk Online through your company Intranet.”