How can I modify this PS1 script to create ths user login ID name not the user full name ?

355LT1
355LT1 used Ask the Experts™
on
How can I modify this PS1 script to create ths user login ID name not the user full name ?

$mbxs = Get-Mailbox -ResultSize Unlimited | Where-Object {$_.WhenCreated -ge ((Get-Date).Adddays(-30))}
$all = @()

foreach ($mbx in $mbxs) {

   $mbxstat = Get-MailboxStatistics $mbx.alias

   $out = new-object psobject  
   
   $out | add-member noteproperty Name $mbx.Name
   $out | add-member noteproperty Servername $mbx.ServerName
   $out | add-member noteproperty Database $mbx.Database
   $out | add-member noteproperty MailboxSize $mbxstat.TotalItemSize

   $all += $out
}

 $all | export-csv E:\temp\Userlast30days.csv

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You want to use $mbx.samaccountname, if this isn't what you want then pass get-mailbox to get-member to see all the returned properties.

get-mailbox ¦ gm

Author

Commented:
I realized I need alias?
Wouldn't it just be $mbx.alias?
Wouldn't it just be $mbx.alias?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial