Posts Tagged ‘mailbox’

Hi Folks,

today’s challenge was to bulk set calendar rights in a multilingual environment (with powershell).
On the net you can find some articles that address similar problems, but no real solution.

Download the follwing scripts as txt here.

Here my quick an dirty script:

# Set default as LimitedDetails for all calendars.
# Will get the language forch each users calendar Folder
# TEST WITH ONE ORE MORE USERS
# foreach($mbx in Get-Mailbox -identity USER | where-object {$_.displayname -like "*test user*"})


foreach($mbx in Get-Mailbox -ResultSize Unlimited | where-object {$_.displayname -notmatch "discovery"})

{
$Calfolder = $Mbx.Name
$Calfolder += ':\'
$CalFolder += [string](Get-mailboxfolderstatistics $Mbx -folderscope calendar).Name
$mbx = $CalFolder
$test = Get-MailboxFolderPermission -Identity $mbx -erroraction silentlycontinue
if($test -ne $null)
{
Set-MailboxFolderPermission -Identity $mbx -User Default -AccessRights LimitedDetails | out-null
}
}

If you want to create all new mailboxes with special permissions you nee to configure the Cmdlet Extension Agent
To enable the agent this you have to the following steps:

  • Create an XML file named ScriptingAgentConfig.xml  and save it in your Exchange’s Default Directory on EVERY Exchange Server in your organization
    e.g. C:\Program Files\Microsoft\Exchange Server\V15\Bin\CmdletExtensionAgents

    <?xml version=”1.0″ encoding=”utf-8″ ?>
    <Configuration version=”1.0″>

    <Feature Name=”MailboxProvisioning” Cmdlets=”New-Mailbox”>
    <ApiCall Name=”OnComplete”>
    if($succeeded)
    {
    start-sleep -s 10
    $mbx =  (Get-User $provisioningHandler.UserSpecifiedParameters[“Name”]).distinguishedName
    Set-MailboxFolderPermission -Identity $mbx”:\Calendar” -User “Default” -AccessRights LimitedDetails
    }
    </ApiCall>
    </Feature>

    <Feature Name=”MailboxProvisioning” Cmdlets=”Enable-Mailbox”>
    <ApiCall Name=”OnComplete”>
    if($succeeded)
    {
    start-sleep -s 5
    $user = Get-User -Identity $provisioningHandler.UserSpecifiedParameters[“Identity”]
    $mbx = Get-Mailbox -Identity $user.DistinguishedName
    Set-MailboxFolderPermission -Identity $mbx”:\Calendar” -User “Default” -AccessRights LimitedDetails
    }
    </ApiCall>
    </Feature>

    </Configuration>

 

  • Use the Exchange Management Shell and run the following command on EVERY Exchange server in your organization:
    Enable-CmdletExtensionAgent “Scripting Agent”
  • Create new user

Cheers,

Chris

If not configured Exchange sets the standard notification schedule to monday, 4 a.m. once a week. To bulk change this, you have to edit all databases properties with the EMC or simply run the following PowerShell command with equals the GUI setting “Daily 2 a.m.” :

Get-MailboxDatabase | Set-MailboxDatabase -QuotaNotificationSchedule ‘So.02:00-So.02:15, Mo.02:00-Mo.02:15, Di.02:00-Di.02:15, Mi.02:00-Mi.02:15, Do.02:00-Do.02:15, Fr.02:00-Fr.02:15, Sa.02:00-Sa.02:15’

To check this settings for all DBs run the following command:

Get-MailboxDatabase | fl Name, QuotaNotificationSchedule

Regards,

Chris

Here’s the PowerShell command to remove the last arbitration mailbox to prepare uninstall of Exchange 2010.

Get-Mailbox -Arbitration | Remove-Mailbox -RemoveLastArbitrationMailboxAllowed

Cheers,

Chris

Here comes the command to get an overview over recoverable items in a mailbox:

Get-MailboxFolderStatistics -Identity user@domain.com -FolderScope RecoverableItems | Format-Table Name,FolderPath,ItemsInFolder,FolderAndSubfolderSize

Regards,

Chris


									

With this command you get an overview over a certain user’s mailbox folders:

Get-MailboxFolderStatistics user@domain.com | ft folderpath, itemsinfolder

You can limit this to special folder, too:

Get-MailboxFolderStatistics -identity user@domain.com -FolderScope ‘DeletedItems’ | Select Identity, FolderPath, ItemsInFolder, FolderSize

Cheers,

Chris

Recently it was necessary to change  the “From” display name of the sending notifications. This notifications appear e.g. when your mailbox size hits the quota or you get an internal NDR. It’s not possible to edit the sender email address in EMC or EMS but you can change the Display Name of this notification sender by using ADSIEdit.

  • Open ADSIEDIT – Configuration
  • Open the following path:
    Services -> Microsoft Exchange -> “Your Exchange Organization” -> Transport Settings
  • Right click properties on CN=MicrosoftExchange329e71ec88ae4615bbc36ab6ce41109e

In the properties navigate to “displayName” and edit the default value named “Microsoft Outlook” to the display name you want to have.

Click OK and close ADSI Edit.

That’s it.

Regards,

Chris

With this PowerShell command you get an overview of database sizes, last full backups and active servers.

(get-mailboxdatabase -status) | foreach-object {write-host $_Server $_.Name $_.lastfullbackup $_.databasesize}

Cheers,

Chris