Exchange 2010 - Useful Powershell Commands
Hi there,
I've just started getting me head round using Exchange Powershell command so I thought I'd share some that I thought useful.
Please add more!
After adding new users run these commands to update the address lists:
Get-Globaladdresslist | update-Globaladdresslist
Get-Addresslist | Update-Addresslist
To restrict the number of recipients members of a database can send mail to:
Get-Mailbox -Database "Database name" -ResultSize Unlimited |Set-Mailbox -RecipientLimits 5
Creating a new mailbox database (new year groups):
new-mailboxdatabase -Server '<EXCHANGE SERVER>' -Name '<DATABASE NAME>' -EdbFilePath 'E:\Exch2010-DBs\<DATABASE NAME>\<DATABASE NAME>.edb' -LogFolderPath 'E:\Exch2010-Logs\<DATABASE NAME>'
Mounting the new database:
Mount-Database -Identity "<DATABASE NAME>"
Setting mailbox limits within a database:
Set-MailboxDatabase -ProhibitSendReceiveQuota '45Mb' -ProhibitSendQuota '40Mb' -IssueWarningQuota '35Mb' -RetainDeletedItemsUntilBackup $true -Identity "<DATABASE NAME>"
Set mailbox offline address book:
Set-MailboxDatabase -OfflineAddressBook '\Default Offline Address Book' -Identity "<DATABASE NAME>"
Create new global address list:
New-GlobalAddressList -Name "<ADDRESS LIST NAME" -RecipientFilter {(MemberOfGroup -eq 'cn=<GROUP NAME>,OU=Exchange Groups,DC=XXX,DC=internal')}
Update GAL:
Update-GlobalAddressList -Identity "<ADDRESS LIST NAME>"
Default GAL permission change:
Add-ADPermission -Identity $dngal -User "<ADDRESS LIST NAME>" -AccessRights extendedright -ExtendedRights "open address list" -Deny:$True