Removing Set Values from a String in PowerShell cmdlet

I am trying to return Emails from an Exchange server but only with the username. For example, I want the value 'jdoe@example.com' to be returned as just 'jdoe'.

What I have is this:

Get-Mailbox -ResultSize unlimited | Select-Object DisplayName, PrimarySmtpAddress | Sort-Object PrimarySmtpAddress | Out-GridView

The other option is to be able to change First Name and Last Name to First Initial and Last Name. For example, Change 'John Doe' to 'jdoe'.



Comments

Popular posts from this blog

I get wrong characters when retreiving the message body of an email using TIdIMAP4.UIDRetrieveTextPeek2()

How to drop the all the 1's in a correlation matrix

Today Walkin 14th-Sept