Tuesday, 15 April 2014

Exchange Management Shell(EMS) Missing :


We often face situations where we do not see Microsoft Exchange Management Shell in our Exchange servers. In such cases, below is the workaround for it.


1.Before we create the shortcut, check if the ConnectFunctions.ps1 , RemoteExchange.ps1 and CommonConnectFunctions.ps1 files are present in the %ExchangeInstallPath%\bin directory.

NOTE : If these files are missing, you can copy the files from the Exchange Server 2010 Service Pack 1 installation media.
These files are present in the \setup\serverroles\common folder.

2. Create a new shortcut in Desktop. Click New -> Shortcut. 

3. In the Type the location of the item , type in the text below:
 

%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command ". '%ExchangeInstallPath%\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto"
 
NOTE : Modify the Exchangeinstallpath to your exchange installation location
 4. Name the shortcut Exchange Management Shell and click Finish.
 
Done. We have created the Shell, so now if you are fine with the blue icon then skip the below steps Below steps are to modify the icon to the original EMS icon

5. Right click the Exchange Management Shell shortcut, click Properties and remove the text from Start In field on the Shortcut tab
6. On the Shortcut tab, click Change Icon , click Browse  and type in the text below:
 

%SystemRoot%\Installer\{4934D1EA-BE46-48B1-8847-F1AF20E892C1}\PowerShell.exe 

7.  Select the Exchange icon and click OK .
8.  Click Apply and click OK .
9.Copy the new Exchange Management Shell shortcut to this location:


%systemdrive%\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Exchange Server 2010

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 !!