Friday, 6 December 2013

Powershell Commands - Exchange 2010

Here are some list of powershell commands that will be useful on our day to day usage. These are assorted but I have highlighted the usage of each commands. Hope they are useful.

1) To export an user mailbox to a .pst file remotely :

New-MailboxExportRequest -Mailbox abc -FilePath \\ex2010a\pst\abc.pst

2) To APPEND users to AcceptMessageOnlyFrom field of a DL. Note : This will append the list of users to the find and it will not replace the existing users.

Set-DistributionGroup -Identity NationalAccountDept -AcceptMessagesOnlyFrom @{add="emp_00","emp_01"}

3) Export list of users who are UM enabled

Get-ummailbox | where {$_.UMenabled -eq $true}

4) Clean emails from user mailboxes from a specific sender

Get-Mailbox -server exch5 -resultsize unlimited | Search-Mailbox -SearchQuery “From:abc@gmail.com” –DeleteContent 

Wednesday, 27 November 2013

"User Properties on this object has invalid data..."

While working on a Exchange 2010 mailbox, I happen to face a situation where I was not able to edit its properties.

When I search the mailbox in EMC console and right click to go to the mailbox properties, I get the below error, warning rather :


When I click "Cancel" the complete properties windows becomes GREYED out however when I click "OK", it gives me a editable screen of the user mailbox properties but later it gives me the below screen :




I then followed the various articles in the net to check if the "User Principle Name" in "Account" tab is set incorrectly as mentioned in the reference articles. But for my surprise, the attribute is already set correctly with a proper domain name :

                      Note : See that the value already has @ symbol and a proper domain name

So I was left out with an option to check the properties of this mailbox in ADSI edit (Run -> adsiedit.msc).
I checked the "userPrncipalName" attribute for the affected mailbox and found it only had the alias name but not the complete name with @domain.com. 

I then edited the attributed with the complete name but that did not work. So I cleared the attribute and HURRAY, it WORKED !!