[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Modify a Power Shell Script

Posted on 2011-09-29
4
Medium Priority
?
258 Views
Last Modified: 2012-05-12
Can someone please modify this PowerShell script so that it will show the "Title" of the user in the output file?

Get-MailboxServer | Get-Mailbox -ResultSize Unlimited |
Get-MailboxStatistics | Where {$_.TotalItemSize -gt 1MB} |
Select DisplayName, LegacyDN, ItemCount,  `
   @{label="CalendarItemSize (MB)";expression={(Get-MailboxFolderStatistics -Identity $_.Identity -FolderScope Calendar).FolderAndSubfolderSize.ToMB()}},  `
   @{label="Total Deleted Size (MB)";expression={$_.TotalDeletedItemSize.Value.ToMB()}},  `
   @{label="Total Size (MB)";expression={$_.TotalItemSize.Value.ToMB()}},  `
   StorageLimitStatus,  Database, LastLogonTime |
Export-Csv All_users_mailbox_sizeV5All-9-28-2011.csv -notypeinformation
0
Comment
Question by:vhaperbaugub
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 27

Expert Comment

by:KenMcF
ID: 36814267
try adding this into your script.


Get-MailboxServer | Get-Mailbox -ResultSize Unlimited | 
Get-MailboxStatistics | Where {$_.TotalItemSize -gt 1MB} | 
Select DisplayName, LegacyDN, ItemCount,
   @{label="CalendarItemSize (MB)";expression={(Get-MailboxFolderStatistics -Identity $_.Identity -FolderScope Calendar).FolderAndSubfolderSize.ToMB()}},
   @{label="Total Deleted Size (MB)";expression={$_.TotalDeletedItemSize.Value.ToMB()}},
   @{label="Total Size (MB)";expression={$_.TotalItemSize.Value.ToMB()}},
   @{label="Title";expression={get-user $_.samaccountname}},
   StorageLimitStatus,  Database, LastLogonTime | 
Export-Csv All_users_mailbox_sizeV5All-9-28-2011.csv -notypeinformation

Open in new window

0
 
LVL 27

Expert Comment

by:KenMcF
ID: 36814331
wait, forgot something in my last post

replace this line

@{label="Title";expression={get-user $_.samaccountname}},

With this

@{label="Title";expression={(get-user $_.samaccountname).title}},
0
 
LVL 27

Accepted Solution

by:
KenMcF earned 2000 total points
ID: 36814374
one more try, after testing this time

@{label="Title";expression={(get-user $_.displayname).title}},
0
 

Author Comment

by:vhaperbaugub
ID: 36814510
Looks like it is working great.....Thanks!
0

Featured Post

Are You Ready for GDPR?

With the GDPR deadline set for May 25, 2018, many organizations are ill-prepared due to uncertainty about the criteria for compliance. According to a recent WatchGuard survey, a staggering 37% of respondents don't even know if their organization needs to comply with GDPR. Do you?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
A walk-through example of how to obtain and apply new DID phone numbers to your cloud PBX enabled users that are configured in Office 365. Whether you have 1, 10 or 100+ users in your tenant, it's quite easy to get them phone-enabled and making/rece…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question