Category: Exchange

  • Who owns an email alias in Microsoft 365?

    A quick an easy way today – how do you find out if an email address/alias is assigned to a user in your Office365 tenancy?

    It’s pretty easy really – although not that obvious. 

    For both of these methods, you’ll need to connect to Office365 with PowerShell. To do that, you need to do the following:

    $cred=get-credentials

    At this point, you’ll be prompted to enter your Office365 Admin Credentials

    Then, you connect to the session using those credentials (below may be wrapped – the $session and Import-PSSession are two lines).

    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $Cred -Authentication Basic -AllowRedirection

    Import-PSSession $Session

    You could then if you wanted export all of your mailbox identities with their email addresses. You can do that with:

    get-mailbox -identity *|select-object Identity, EmailAddresses|export-csv csvout.txt

    This would put all of your mailboxes and associated Email-Addresses into a CSV.

    More specifically, you could just search for the email address you’re interested in – you can do that with this command:

    Get-Mailbox -Identity * | Where-Object {$_.EmailAddresses -like ‘smtp:emailaddress@domain.com‘} | Format-List Identity, EmailAddresses

    Obviously change the ’emailaddress@domain.com’ to whatever you’re looking for. You can use wildcards too, so for example DA*@contoso.com would find any alias beginning with DA and @contoso.com

    Output is similar to this:

    Example Output

    In the words of Heath Ledger…Da Daaaaaa.

  • Outlook Advanced Searching

    The company I currently work for is in love with Email. Lots and lots of it. In fact, I’m fairly sure it’s their goal to deliver all the email everywhere.

    Anyway, a side effect of this is that often you know you have some information, from someone, somewhere, about something and it’s hard to track it down.

    Sure, Outlook has search, but hell you can never find anything, right? Well, having watched some people use the Outlook search I can understand why they can never find anything – I suspect people don’t realise exactly how powerful Outlook search is. There are great and simple ways to narrow the scope of your Email searches making it far, far easier to find the stuff you want.

    Simple things like AND and OR. Search for Andy Pandy for example and Outlook will search for messages that contain:

    Andy OR Pandy – and not in that order either. So emails with Pandy Andy will also show up.

    It’s the most common misunderstanding of Outlook search I see, and why people can’t find things. If you wanted something that contained Andy AND Pandy you could search for:

    Andy AND Pandy

    …or search for emails with Andy in, but not Pandy. Guess how we do that?

    Andy NOT Pandy

    You can also of course search for the explicit phrase by searching for “Andy Pandy” (I.e. In quotes).

    There are also some far more powerful search methods such as:

    From: Emails from that person.
    Hasattachment:Yes Only emails that have an attachment.
    Attachments:attachmentname Only emails with that specific attachment – very useful
    Received:=date Items only received on that day
    Received:yesterday Take a guess on that? Also tomorrow/today…
    Received:last week …wild stab in the dark?

    You can of course combine all of them – let’s imagine we want to find an email from Andy.Pandy@contoso.com, that has an attachment, and you received it last week. Well, you could search for:

    From:Andy.Pandy@contoso.com HasAttachment:yes Received:last week

    Boom, there’s your search.

    It’s really worth getting to know the search parameters, it makes finding stuff so, so much easier.

    In fact, Microsoft has made it even easier by listing it all in one cool place for you:

    Learn to narrow your search criteria for better searches in Outlook

    You can see a video run through of how it works, and why it’s so cool, below. This was produced by Webucator, they produce a number of Microsoft Outlook Online and Onsite Training Classes. Must admit I do like video run throughs of stuff – it makes things so much easier to, well, visualise. Always find quite astonishing when some companies ban things like YouTube – how many people now when they want to know how to do stuff would immediately turn to YouTube? I know I do.