Showing posts with label Powershell. Show all posts
Showing posts with label Powershell. Show all posts

Tuesday, 10 September 2013

Giving SendAs permissions to a distribution Group

Once you have created a distribution group, if you need one user to have sendas permission then do the following in exchange powershell
Set-DistributionGroup GROUPEMAILADDRESS@domain.com -GrantSendOnBehalfto USER@domain.com

to set a multiple group use the following



Set-DistributionGroup GROUPEMAILADDRESS@domain.com -GrantSendOnBehalfto @{Add="USER@domain.com", "USER2@domain.com", "USER3@domain.com"}

to check who has access

Get-DistributionGroup GROUPEMAILADDRESS@domain.com | fl name,grant*

Tuesday, 12 February 2013

Using Exchange Powershell to report on Mailbox Sizes


Here are some useful Exchange 2010 Powershell commands I use regularly to report on where users are filling up our Exchange Databases. 

(note 'MBX-SERVER' is your mailbox server name with the ' removed, "username" is the username and the quotes remain)

Database Size
Get-MailboxDatabase -Status | select name,databasesize,availablenewmailboxspace


Mailbox Size
Get-MailboxStatistics -Server 'MBX-SERVER' | Select DisplayName, ItemCount, TotalItemSize | Sort-Object TotalItemSize -Descending | Export-CSV C:\MailSize.csv
Drops to the csv on the C drive


Show top ten Mailbox folders with most Items on the Mailbox Server
Get-Mailbox –Server 'MBX-SERVER' -ResultSize Unlimited | Get-MailboxFolderStatistics | Sort-Object ItemsInFolder –Descending | Select-Object -First 10 | FT Identity,ItemsInFolder,FolderSize –Wrap


Top Ten folders in one users Mailbox by size
Get-Mailbox -Identity "username" -ResultSize Unlimited | Get-MailboxFolderStatistics -FolderScope All | Sort-Object FolderSize -Descending | Select-Object -First 10 | FT Identity,FolderSize,ItemsInFolder –wrap