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

Spring Elasticsearch Operations

Network Error and Timeout on Authorize.net JS

Object oriented programming concepts (OOPs)