Exchange Misc
Exchange 2010 SP3
New-ManagementRoleAssignment -Role "Mailbox Import Export" -User user1
Get-MailboxJunkEmailConfiguration -Identity "Surname, Givenname"
ActiveSync stuff
Get-ActiveSyncDevice -ResultSize unlimited | Get-ActiveSyncDeviceStatistics | where {$_.LastSyncAttemptTime -lt (get-date).adddays(-90)} | Export-Csv -NoTypeInformation more-than-90-days -Encoding UTF8
Get-ActiveSyncDevice -ResultSize unlimited | Get-ActiveSyncDeviceStatistics | where {$_.LastSuccessSync -le (Get-Date).AddDays("-30")} | Export-Csv -NoTypeInformation more-than-30-days -Encoding UTF8
More info:
Remove Stale/Old Active Sync Devices from All Mailboxes
Manage a Mobile Device
ActiveSync - increase UploadReadAhead
Modify the web.config file under the Microsoft-Server-ActiveSync site in IIS for all CAS server. This modification changes the following:
MaxDocumentDataSize = 51200000
maxRequestLength = 51200
Then, in the command prompt, as an Administrator:
C:\Windows\System32\inetsrv
appcmd.exe set config -section:system.webServer/serverRuntime /uploadReadAheadSize:"10485760" /commit:apphost
Open the Default Web Site in IIS and select "Advance Settings"
Expand Connection Limits and increase the value to "240"
Then: iisreset
And -> IIS Manager - Application Pools - DefaultAppPool - select "Recycle" - the same with MSExchangeSyncAppPool.
This will increase the default limits in exchange for email size using ActiveSync (not recommended bigger than this)
Impersonation
New-ManagementRoleAssignment -Name:"admin1 Impersonation" -Role:ApplicationImpersonation -User:admin1 -CustomrecipientWriteScope "admin1 Impersonation Mailboxes"
New-ManagementScope -Name:"admin1 Impersonation Mailboxes" -RecipientRestrictionFilter { (Name -eq "user1") -Or (Name -eq "user2") }
New-ManagementScope -Name:"admin1 Impersonation Mailboxes" -RecipientRestrictionFilter { (UserPrincipalName -eq "user3@somedomain.org") -Or (DisplayName -eq "User 4") }
Get-ManagementRoleAssignment -RoleAssignee "admin1"
Get-ManagementRoleAssignment -RoleAssignee "admin1" -Role ApplicationImpersonation -RoleAssigneeType user
Remove-ManagementRoleAssignment "admin1 Impersonation"
Remove-ManagementScope "admin1 Impersonation Mailboxes"
IMCEAEX (X500, legacyExchangeDN)
Info: IMCEAEX non-delivery report when you send email messages to an internal user in Office 365 dedicated
To create an X500 proxy address for the old LegacyExchangeDN attribute for the user, make the following changes based on the recipient address in the NDR:
Replace any underscore character (_) with a slash character (/).
Replace "+20" with a blank space.
Replace "+28" with an opening parenthesis character.
Replace "+29" with a closing parenthesis character.
Replace "+2E" with .
IMCEAEX-_O=COMPANY+20PSI_OU=EXCHANGE+20ADMINISTRATIVE+20GROUP+20+28FYDIBOHF23SPDLT+29_CN=RECIPIENTS_CN=Surname+2C+20Givenname1b0@companypsi.vgb
#550 5.1.1 RESOLVER.ADR.ExRecipNotFound; not found ##
Then in User mailbox - Email addresses - Add - Custom address:
X500: /O=COMPANY PSI/OU=EXCHANGE ADMINISTRATIVE GROUP (FYDIBOHF23SPDLT)/CN=RECIPIENTS/Surname, Givenname1b0