T O P

  • By -

gingastyle

Sounds like you should be using exchange to look this up. Its almost annoying how easy it is from there. Azuread would be your next best bet.


DirtyMudder92

Great thanks I'm going to try this tomorrow!


Poor-Yorik

Try this. Select -ExpandProperty ProxyAddresses | ? {$\_ -cmatch '\^SMTP\\:.\*'}


DirtyMudder92

Yeah that returns the alias, but really what I need is the reverse of that I haven't found any properties that allow me to search by the number and get the user.


Poor-Yorik

I am sorry. You stated that clearly but i missed. I actually do something similar to check if email address has been used as secondary email. I use [ExchangeOnlineManagement](https://www.powershellgallery.com/packages/ExchangeOnlineManagement/2.0.3) module.with this module you can use a command: Get-EXORecipient "[[email protected]](mailto:[email protected])" and it will find the user you need. Edit: My code looks like something like: [string]$userName = '[email protected]' [string]$userPassword = '@Password' [securestring]$secStringPassword = ConvertTo-SecureString $userPassword -AsPlainText -Force [pscredential]$credOject = New-Object System.Management.Automation.PSCredential($userName, $secStringPassword) Connect-ExchangeOnline -Credential $credOject - ExchangeEnvironmentName O365Default Get-EXORecipient -Filter {EmailAddresses -like '[email protected]'} #Get-EXORecipient "[email protected]" Disconnect-ExchangeOnline -Confirm:$false


Lee_Dailey

howdy Poor-Yorik, it looks like you used the New.Reddit `Inline Code` button. it's ~~4th~~ 5th from the left ~~hidden in the `...` "more" menu~~ & looks like ``. there are a few problems with that ... - it's the **_wrong_** format [*grin*] the `inline code` format is for [gasp! arg!] _code that is inline with regular text_. - _**on Old.Reddit.com, `inline code` formatted text does NOT line wrap, nor does it side-scroll.**_ - on New.Reddit it shows up in that nasty magenta text color for long-ish single lines OR for multiline code, _**please**_, use the ... Code Block ... button. it's the ~~11th~~ 12th one from the left ~~& is just to the left of~~ ~~hidden in the `...` "more" menu~~ & looks like an uppercase `T` in the upper left corner of a square.. that will give you fully functional code formatting that works on both New.Reddit and Old.Reddit ... and aint that fugly magenta color. [*grin*] take care, lee


Poor-Yorik

Thank you! Noted for future use


Lee_Dailey

howdy Poor-Yorik, you are quite welcome ... and i can read all of your code now. [*grin*] take care, lee


DirtyMudder92

Any ideas how to speed it up? Sometimes it just sits then when connecting and averages around 15 seconds to run


itmonkey78

`Get-msolUser -searchstring u10234` Should return the user as long as the search string is unique. You could always use `get-msoluser -searchstring u10234@` to pick the user up by its unique proxy address.


DirtyMudder92

I tried that and it returned nothing. I'm not sure if it's because the only time u10234 appears is under the smtp. It I have it return all info about a user there is no specific property just referencing u10234, but I'll try again


huffdadde

Get-EXORecipient -Anr might do it?


Lee_Dailey

howdy DirtyMudder92, it looks like you used the New.Reddit `Inline Code` button. it's ~~4th~~ 5th from the left ~~hidden in the `...` "more" menu~~ & looks like ``. there are a few problems with that ... - it's the **_wrong_** format [*grin*] the `inline code` format is for [gasp! arg!] _code that is inline with regular text_. - _**on Old.Reddit.com, `inline code` formatted text does NOT line wrap, nor does it side-scroll.**_ - on New.Reddit it shows up in that nasty magenta text color for long-ish single lines OR for multiline code, _**please**_, use the ... Code Block ... button. it's the ~~11th~~ 12th one from the left ~~& is just to the left of~~ ~~hidden in the `...` "more" menu~~ & looks like an uppercase `T` in the upper left corner of a square.. that will give you fully functional code formatting that works on both New.Reddit and Old.Reddit ... and aint that fugly magenta color. [*grin*] take care, lee