Posts

Showing posts from 2024

Microsoft Exchange: Mailboxes forwarding to Specific Mailbox

 The following will list all mailboxes on your tenant that are forwarding to the specified recipient. $RecipientCN = (get-recipient johndoe).Identity Get-Mailbox -ResultSize Unlimited -Filter {ForwardingAddress - ne $null} | Where-Object {$_.ForwardingAddress -eq $RecipientCN} Huge thanks to Grant for answering pr0digy's question over on Stack Overflow

Get a User's Active Directory Groups

Problem: You need to list out a User's AD Groups quickly and in a way you can copy and paste them. Solution: So we can use the Get-ADUser cmlet with the "Properties" parameter specifying "Member Of" to get a list of AD Groups. The issue is the groups are formatted as distinguished names which are not very easy to read. PS C:\Users\jheisler> (Get-ADUser -Identity "jheisler" -Properties "MemberOf").MemberOf CN=ITTeam,OU=O365,DC=johnjheisler,DC=com CN=ACL-ITDevOps,OU=Security Groups,OU=Groups,DC=johnjheisler,DC=com Thankfully, All we need to do to overcome this is pipe the Get-ADUser cmdlet into a Get-ADGroup cmdlet. Then we can specify the "Name" property off the AD Group objects. PS C:\Users\jheisler> ((Get-ADUser -Identity "jheisler" -Properties "MemberOf").memberof | Get-ADGroup).Name ITTeam ACL_ITDevOps That's it. A quick and clean way to list a user's AD Groups. https://github.com/Snowstuff123/Po...

Hybrid Exchange: Mailbox in cloud, but not On-Prem

 In an Exchange Hybrid Environment, you can run into an issue where an On-Prem AD account is assigned an o365 license and  creates a Cloud mailbox before its migrated. This will leave you in a situation where there is a mailbox in the cloud and no mailbox On-Prem. Fixing this is very easy: All you need to do is run this command in your On-Prem instance Enable-RemoteMailbox "user identity" -RemoteRoutingAddress "user@contoso.mail.onmicrosoft.com" That's It! Told you it was easy. Reference:  How to recover when a mailbox exists in both Exchange Online and on-premises - Exchange | Microsoft Learn