Showing posts with label Exchange 2010. Show all posts
Showing posts with label Exchange 2010. Show all posts

Tuesday, October 22, 2013

Public Folders Permissions on Exchange 2007/2010

I used to work with Exchange System Manager when managing permissions on Exchange Public Folders, but last week got in trouble when in need to do it on our recently migrated to Exchange 2007 PFs. Turns out that Exchange Management Console doesn't seem to have any feature to manage the Public Folders permissions, so we need to use Power Shell in order to do it. Below are the cmdlets that will help us with that:

To add administrative permissions:

  Add-PublicFolderAdministrativePermission -Identity "\FolderPath" -AccessRights ACCESSRIGHTS -User USERNAME

-AccessRights parameter value may be:
  • None
  • ModifyPublicFolderACL
  • ModifyPublicFolderAdminACL
  • ModifyPublicFolderDeletedItemRetention
  • ModifyPublicFolderExpiry
  • ModifyPublicFolderQuotas
  • ModifyPublicFolderReplicaList
  • AdministerInformationStore
  • ViewInformationStore
  • AllExtendedRights
To add client permissions:

  Add-PublicFolderClientPermission -Identity "\FolderPath" -AccessRights ACCESSRIGHTS -User USERNAME

-AccessRights parameter value may be:
  • ReadItems
  • CreateItems
  • EditOwnedItems
  • DeleteOwnedItems
  • EditAllItems
  • DeleteAllItems
  • CreateSubfolders
  • FolderOwner
  • FolderContact
  • FolderVisible
To add send as permissions (for mail enabled public folders):

  Add-ADPermission "\All Public Folders\FolderPath" -User "USERNAME" -Extendedrights "Send As"

Here comes the complicated part...

In order to recursively add permissions to a folder and its subfolders, we'll need to use a script we'll find in Exchange Server: AddUsersToPFRecursive.ps1, however, this script will remove the user's permissions before adding the new ones, and that will require confirmation, which will be a pain if we're talking about too many subfolders (believe me, in my case there were hundreds of them). So I've made a small change in the script and renamed AddUsersToPFRecursive-No-Confirm.ps1 to keep the original.

All you need to do in order to remove the confirmation is to find this line:

  $permission | remove-PublicFolderClientPermission -identity $_.Identity -server $_.OriginatingServer

And add "Confirm:$false" in the end.

  $permission | remove-PublicFolderClientPermission -identity $_.Identity -server $_.OriginatingServer -Confirm:$false

Then save the script with a new name as I did, or one you prefer.

Once you have it done, you just need to call the script from the Shell console as usual:

  AddUsersToPFRecursive-No-Confirm.ps1 -TopPublicFolder "'\Europe\France'" -User "LAURENT_BARONI" -Permission Owner

** Note that I've put quotes " and an apostrophe ' on the parameter -TopPublicFolder. That's not a typo, don't ask me why, but this was the only way I could make it work. But it works, I promise :)

More info:
Add-PublicFolderAdministrativePermission cmdlet
Ler o texto inteiro ►

Moving Mailboxes in Exchange 2007 and 2010 via PowerShell - What is different?

Exchange 2010 treats quite differently mailbox moves than 2007 version. We were used to use Move-Mailbox cmdlet in order to move mailboxes across servers/databases instantly, however with the mailbox disconnected (offline). Now we must use New-MoveRequest cmdlet to queue up a request which will be completed in background, which means the user will still be able to use it during the operation.

Exchange 2007 syntax:

 Move-Mailbox -Identity USERNAME -TargetDatabase DATABASE -BadItemLimit INT

Exchange 2010 syntax:

 New-MoveRequest -Identity USERNAME -TargetDatabase DATABASE -BadItemLimit INT

You can get updates about the move request by using Get-MoveRequest cmdlet:


 Get-MoveRequest -Identity USERNAME

More info:
Move-Mailbox cmdlet
New-MoveRequest cmdlet
Get-MoveRequest cmdlet
Ler o texto inteiro ►

Wednesday, August 31, 2011

How to reset user's Unified Messaging VoiceMail PIN via PowerShell

This one is so easy that I won't type too much :)

Set-UMMailboxPIN  -Identity USERNAME

Most used parameters:

  • Pin: use this parameter to manually set a new pin to the user
  • SendEmail: set this parameter to $false if you don't want the user to receive an e-mail with the new pin. The default value is $true, which means the user will receive an e-mail with the new pin and information about phone access numbers
  • NotifyEmail: specifies the email address that the automated email will be sent to
  • PinExpired: specifies whether the new Pin will be treated as expired, which means that the user should change it at the first log on.

More info:
Ler o texto inteiro ►

How to get mailbox permissions

Last article I've posted (How to grant/remove permissions on an Exchange 2007 mailbox) was about how to SET mailbox permissions, but another cool thing we can do with PowerShell is to GET them for that, you must use the cmdlet Get-MailboxPermission.

Get-MailboxPermission -Identity MAILBOX | Format-Table User, AccessRights, IsInherited

Most used parameters:
  • Identity: username or email address associated to the mailbox
  • User: use this parameter to check the rights an user has on the mailbox
  • Owner: use this parameter to check users who have owner rights on the mailbox

More info:
Ler o texto inteiro ►

Tuesday, August 30, 2011

How to check Exchange databases status via PowerShell

Run the cmdlet Get-MailboxDatabase to get information about the DB status. Use parameter -Identity to check the status of a single DB and -Server for all DBs in a server.


Check the status of a single DB

Get-MailboxDatabase -Identity DBNAME -Status | Format-Table Name, Mounted, BackupInProgress, OnlineMaintenanceInProgress

Check the status of all DBs in a Server
Get-MailboxDatabase -Server SERVERNAME -Status | Format-Table Name, Mounted, BackupInProgress, OnlineMaintenanceInProgress

* The -Status parameter specifies whether the script will get status information from the DB(s) or not. If not provided, the attributes Mounted, BackupInProgress and OnlineMaintenanceInProgress will return empty.


More info:
Get-MailboxDatabase cmdlet
Ler o texto inteiro ►

Monday, August 29, 2011

How to specify PowerShell session scope

As well as Exchange Management Console, Exchange Shell Console allows you to define the operations scope. You can choose for viewing and working either on the entire forest or on a single domain.

Exchange 2007
$AdminSessionADSettings.DefaultScope="domain1.contoso.com"
$AdminSessionADSettings.ViewEntireForest=$true


Exchange 2010
Set-AdServerSettings -RecipientViewRoot "domain2.contoso.com"
Set-AdServerSettings -ViewEntireForest $true

* when set to the entire forest, all settings changed will take longer than usual to replicate
Ler o texto inteiro ►

How to mount/dismount mailbox databases via PowerShell

For several times I had to dismount and re-mount all the mailbox databases from a server, and doing this via Exchange Management Console is way to slow, so I've researched a bit and found some commands to do this with PowerShell.

How to check Exchange databases status via PowerShell

In order to mount/dismount DBs, use Mount-Database and Dismount-Database respectively. Use Get-MailboxDatabase cmdlet with -Server parameter to fetch the DBs from a server and then the mount/dismount cmdlet.

Dismount a single DB
Dismount-Database -Identity DBNAME -Confirm:$False

Dismount all DBs of a server
Get-MailboxDatabase -Server SERVERNAME | Dismount-Database -Confirm:$False

Mount a single DB
Mount-Database -Identity DBNAME -Confirm:$False

Mount all DBs of a server
Get-MailboxDatabase -Server SERVERNAME | Mount-Database -Confirm:$False

Ler o texto inteiro ►
Related Posts Plugin for WordPress, Blogger...