Some Exchange Powershells

1. How to remove disconnected mailboxes:

Remove-StoreMailbox –database “DB2” –identity “Chakka Rajith” –MailboxState Disabled

If you want to remove all disconnected mailboxes from a database, run the following command

Get-MailboxStatistics –Database “dbname” | Where-Object {$_.DisconnectReason –eq “Disabled”} | ForEach {Remove-StoreMailbox –Database $_.database –identity $_.mailboxguid –MailboxState Disabled

If you want to remove all soft-deleted mailboxes from a database, run the following command

Get-MailboxStatistics –Database “dbname” | Where-Object {$_.DisconnectReason –eq “Softdeleted”} | ForEach {Remove-StoreMailbox –Database $_.database –identity $_.mailboxguid –MailboxState softdeleted

2. Point Exchange RPC client access server:

Get-MailboxDatabase | fl RpcClientAccessserver

Set-MailboxDatabase -RpcClientAccessServer “outlook.domain.com”

3. Clean mailboxes to get them shown in the disconnected mailboxes:

Get-Mailboxstatistics -server active-mail | Where-Object { $_.DisconnectDate -ne $null } | FL DisplayName,LegacyDN,ItemCount,OriginatingServer

Clean a certain mailbox database with this command:

Clean-MailboxDatabase "Mailbox Database"

Clean all databases with this command:

Get-MailboxDatabase | Clean-MailboxDatabase

4. Assign full access to the all mailboxes on the mailbox database:

Get-MailboxDatabase -identity [mailbox database name] | Add-ADPermission -user [username] -AccessRights GenericAll

5. Assign full access to individual mailbox:

get-user -identity domainUSR | Add-MailboxPermission -User domainUSR -AccessRights 'FullAccess'

6. Enable anonymous authentication on receive connector:

add-adpermission 'Relay' -User 'NT AUTHORITYANONYMOUS LOGON' -ExtendedRights ms-Exch-SMTP-Accept-Authoritative-Domain-Sender

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/208722/viewspace-1052243/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/208722/viewspace-1052243/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值