Exchange
Powershell

When you need to view the fullaccess rights for a particulair mailbox type:

Get-Mailbox -Identity fm.mailboxname | Get-MailboxPermission | where {($_.AccessRights
-eq "FullAccess") -and ($_.IsInherited -eq $false) -and -not ($_.User -like "NT AUTHORITY\SELF") } | Format-Table -auto >> c:\users\username\desktop\output.txt

When you need to know who has fullAccess and send-as right type:
Get-Mailbox -Identity 'mailboxname| Get-MailboxPermission | where {($_.AccessRights -eq "FullAccess") -and ($_.IsInherited -eq $false) -and -not ($_.User -like "NT AUTHORITY\SELF") } | Format-Table -auto
Get-Mailbox 'mailboxname' | get-adpermission | select user, extendedrights | where {($_.extendedrights -like 'send-as') -and ($_.user -notlike '*SELF*') -and ($_.user -notlike '*S-1-5*')}

When you want to export a mailbox you need exchange management tools on a 32-bit system
You would then add the logged on user rights of full access on the mailbox you want to export by:
Get-Mailbox -Identity UserAccountOfMailboxToBeExported | Add-MailboxPermission -User UserAccountThatWantsToExportTheMailbox -AccessRights FullAccess

Then when the rights are set type:
Export-Mailbox -Identity UserAccountOfMailboxToBeExported -PSTFolderPath \\pathWherePstNeedsToGo\outlook.pst

When you need to bulk add users to several mailboxes you could proceed like this:
A csv file filled with:
theMailbox, theUser
MailboxName, UserThatNeedsRights
MailboxName, UserThatNeedsRights

You could edit this file with notepad. Then you would run a script like sendas.ps1

$Thelist = Import-csv "C:\thelist.csv"
ForEach($theobject in $Thelist) {$theMBDN = (Get-Mailbox $theobject.themailbox).distinguishedname; Add-ADPermission $theMBDN -Extendedrights "Send As" -User $theobject.theuser}

When the user needs FullAccess you would run a script like FullAccess.ps1
$Thelist = Import-csv "C:\thelist.csv"
ForEach($theobject in $Thelist) {$theMBDN = (Get-Mailbox $theobject.themailbox).distinguishedname; Add-MailboxPermission $thembDN -Accessrights "FullAccess" -User $theobject.theuser}

To view if there is a hick-up in the queue type:
Get-Queue -Server ServerName

If you would like to restore some mails from e.g. veeam backup of exchange you would also need to have impersonate rights on the mailbox, standard you do not have these rights. So to impersonate rights are set as follows:

New-ManagementRoleAssignment -Name:impersonationAssignmentName -Role:ApplicationImpersonation -User:AdminAccountName

If you want to see the status of an activesyn device for a particulair user you could type:
Get-ActiveSyncDeviceStatistics -mailbox "UserName" | Select *

Or if you want to check if active sync is enabled for a user you could type:
Get-CASMailbox -Identity 'username' | fl ActiveSyncEnabled

On Me

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License