Exchange Server Share

July 27, 2009

Exchange 2007: Database Statistics in Powershell

Many times we need to find number of mailboxes in each database and the size of the database (EDB file) of all servers in an Exchange 2007 environment. With PowerShell, it is fairly simple to grab in a single line.

1.  How do we find number of mailboxes in each database?

On Screen: Get-MailboxDatabase | Select Server, StorageGroupName, Name, @{Name="Number Of Mailboxes";expression={(Get-Mailbox -Database $_.Identity | Measure-Object).Count}} | Format-Table -AutoSize

Export to CSV: Get-MailboxDatabase | Select Server, StorageGroupName, Name, @{Name="Number Of Mailboxes";expression={(Get-Mailbox -Database $_.Identity | Measure-Object).Count}} | Export-Csv C:\ServerStat-1.csv

2.  How do we find number of mailboxes and size of EDB file for each Database?

On Screen: Get-MailboxDatabase | Select Server, StorageGroupName, Name, @{Name="Size (GB)";Expression={$objitem = (Get-MailboxDatabase $_.Identity); $path = "`\`\" + $objitem.server + "`\" + $objItem.EdbFilePath.DriveName.Remove(1).ToString() + "$"+ $objItem.EdbFilePath.PathName.Remove(0,2); $size = ((Get-ChildItem $path).length)/1048576KB; [math]::round($size, 2)}}, @{Name="Size (MB)";Expression={$objitem = (Get-MailboxDatabase $_.Identity); $path = "`\`\" + $objitem.server + "`\" + $objItem.EdbFilePath.DriveName.Remove(1).ToString() + "$"+ $objItem.EdbFilePath.PathName.Remove(0,2); $size = ((Get-ChildItem $path).length)/1024KB; [math]::round($size, 2)}}, @{Name="No. Of Mbx";expression={(Get-Mailbox -Database $_.Identity | Measure-Object).Count}} | Format-table -AutoSize

Export to CSV: Get-MailboxDatabase | Select Server, StorageGroupName, Name, @{Name="Size (GB)";Expression={$objitem = (Get-MailboxDatabase $_.Identity); $path = "`\`\" + $objitem.server + "`\" + $objItem.EdbFilePath.DriveName.Remove(1).ToString() + "$"+ $objItem.EdbFilePath.PathName.Remove(0,2); $size = ((Get-ChildItem $path).length)/1048576KB; [math]::round($size, 2)}}, @{Name="Size (MB)";Expression={$objitem = (Get-MailboxDatabase $_.Identity); $path = "`\`\" + $objitem.server + "`\" + $objItem.EdbFilePath.DriveName.Remove(1).ToString() + "$"+ $objItem.EdbFilePath.PathName.Remove(0,2); $size = ((Get-ChildItem $path).length)/1024KB; [math]::round($size, 2)}}, @{Name="No. Of Mbx";expression={(Get-Mailbox -Database $_.Identity | Measure-Object).Count}} | Export-CSV C:\ServerStat-2.csv

July 15, 2009

Shared Mailbox added in outlook profile but, where will Sent Item be saved?

Filed under: Exchange, Exchange 2003, Exchange 2007, Outlook — Amit Tank @ 9:23 pm
Tags: , , ,

There is a common query across everywhere, when we add a shared mailbox in outlook profile and sending a mail from that account (using Send-As or Send On Behalf of) by specifying it in From field, mail item will be saved into ‘Sent Item’ of primary mailbox instead of ‘Sent Item’ folder of shared mailbox as per normal behaviour of Outlook.

Something like when I opened ‘Support’ mailbox in my outlook profile as an additional mailbox and sending mail from ‘Support’ mailbox by specifying it into From field. It will be saved into ‘Sent Item’ of Amit Tank’s mailbox and not in Sent Item of ‘Support’ mailbox.!!

So how do we configure it to be saved into Sent Item of Shared mailbox by default? So far we had to use some third-party utility like IvaSoft Unisent but now Microsoft has given an easy solution for it.

Solution:

Outlook 2007: Microsoft has released an Outlook 2007 hotfix package dated June 30, 2009 to resolve certain issues and this issue is addressed in that list.

So Install this hotfix package and add a registry key to make it enable.

1. Hotfix: Description of the Outlook 2007 hotfix package (Outlook.msp): June 30, 2009

2. Set below registry key as per KB972148 to enable this functionality.

[HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Preferences]
"DelegateSentItemsStyle"=dword:00000001

Voila! Now all mails, sent from shared mailbox account, are being saved into ‘Sent Item’ of shared mailbox.

Update:

Outlook 2003: Similar hotfix KB953803 requires to be installed for Outlook 2003 and add the registry key mentioned in KB953804 to enable this functionality.

July 7, 2009

How to: Setup Read Only Mailbox in Exchange 2003/2007

Filed under: Exchange, Exchange 2003, Exchange 2007, OWA — Amit Tank @ 9:52 pm
Tags: , , ,

This is frequently asked question, “How to setup Read-only Mailbox?” or “How to give Read-Only permission to access mailbox?” in Exchange 2003/2007. Procedure is tricky but moderately possible.

We have two places where we can give minimum permission to access any mailbox. Refer below article at MS Exchange Team blog for more details.
Minimum permissions necessary to access mailbox data

  1. Active Directory Mailbox ACLs – Full Mailbox Permission requires in the mailbox ACLs at Active Directory level to access mails, so this is not correct place where we can configure Read-Only permission.
  2. MAPI Folder Permissions – This is the correct place for our requirement. Let’s discuss how to do so.

As always let’s take an example. I am owner of mailbox called “Support” mailbox and I have Full Mailbox Access on it. Now I want to share Support mailbox with any user or a set of users (in from of group) but as a Read-Only and don’t want to allow them deleting any items inside.

If you are selecting a group to configure permission then it should be Mail Enabled Security group. If you are using distribution group to assign permission then it gives you an error while assigning permission in Outlook. It is always recommended to use security group while assigning permissions.

Let’s say I am going use “#Support Team”  Mail Enabled Security group to assigned read only permission on “Support” mailbox hence member of “#Support Team” will be able to open it.

 

 

Now to open any mailbox and view all folders inside it, we need to give MAPI permission starting from Top of the Mailbox object “Mailbox – <Mailbox Display Name>” in Outlook.

1. Right Click on “Mailbox – Support” and click “Change Sharing Permission…” (“Sharing…” if you are using Outlook 2003).

2. Click on Add and select “#Support Team” from GAL, give at least “Folder
Visible” (or you can also give Reviewer) permission to view all mailbox folders.

 

3. Now, Right click on “Inbox” and click on “Change Sharing Permission…” or “Sharing…”.

4. Click “Add”  and select the “#Support Team” from GAL and give “Reviewer” permission.

Follow step 3 & 4 for all folders which you want to share with group.

Sheldon Labrooy is one of the member of “#Support Team”.

 

So Sheldon can add “Support” mailbox into Outlook profile by going to Tools –> Account Settings –> Change Email Account –> More Settings –> Advance Tab –> Click Add in “Mailboxes – Open these additional Mailboxes:” and select Support mailbox.

 

 

Sheldon can see all items available in Support mailbox and he will be able to Reply or Forward.

But he is not allowed to Delete or Move any items in it.

  

Its pretty simple to add and open any mailbox in Outlook but how to open it in OWA? Reason is OWA requires Full Mailbox access to open full content of OWA site, otherwise it gives an error telling that you don’t have permission to access mailbox, so what you can do in Read-Only mailbox case?

Sometime back I discussed how to open shared calendar in OWA and user can use same method here to open “Inbox” of any read only mailbox.

User can use below direct links for respective folders and give their own user id and password to open it in OWA.

Inbox https://<FQDN of server>/owa/<smtpaddress>/?cmd=contents
Subfolder of Inbox https://<FQDN of server>/owa/<smtpaddress>/?cmd=contents&f=inbox%2fSubFolder
Calendar https://<FQDN of server>/owa/<smtpaddress>/?cmd=contents&module=calendar
Contacts https://<FQDN of server>/owa/<smtpaddress>/?cmd=contents&module=Contacts
Tasks https://<FQDN of server>/owa/<smtpaddress>/?cmd=contents&module=Tasks

July 6, 2009

Exchange 2010: ‘Send As’ and ‘Send on Behalf Of’ in OWA

Filed under: Exchange, Exchange 2007, Exchange 2010, OWA — Amit Tank @ 10:58 pm
Tags: , , ,

As we know Exchange 2010 is coming with many wonderful new and improved features. Let me demonstrate one of the long awaited feature, “Send-As” or “Send on Behalf Of” in OWA..!!!

Before going forward, let me show you how to enable BCC and From fields in options.

Go to Options –> Settings –> Mail –> Message format and enable below option “Always Show From” and also if you want enable Bcc field to available always by default, select “Always Show Bcc”.

Yes, that’s true now you can keep Bcc option enabled by default in Exchange 2010 as opposed to enabling every time from “Options” while drafting a new mail in Exchange 2007 (however there is a workaround to keep it enabled by default in Exchange 2007).

Back to main topic, when you draft a new mail, you can see ‘From’ tab and you can select “Other e-mail address…” on the account you have Send-As or Send on Behalf Of permissions.

Send On Behalf Of : Let’s say I have Send On Behalf Of permission on Jayesh Raval, I selected it in From field and sending a mail to Santosh Pandya.

Santosh Pandya will see a mail from “Amit Tank on behalf of Jayesh Raval”.

Send As : Let’s say I have Send As permission on Nikunj Khunt, I selected it in From field and sending a mail to Santosh Pandya.

Santosh Pandya will see that mail came from Nikunj Knunt.

Now if you don’t have Send As or Send on Behalf of permission, of course Mail Tips gives you an error and doesn’t allow you to send mail like outlook.

Isn’t OWA 2010 a shadow of Outlook? Kudos to Exchange team for making such an immense product for us…!!

July 2, 2009

Exchange 2007 SCW and Windows 2008 SP2?

Filed under: Exchange, Exchange 2007, Tools — Amit Tank @ 7:57 pm
Tags: , ,

Sometime back an issue posted on TechNet forum but now looks many people are looking about same so though of documenting it. However Microsoft is aware about this and we will get the resolution soon.

Issues is, when you install Exchange 2007 on Windows 2008 Service Pack 2 and try to register SCW to secure Exchange Server Role with below cmdlet, it gives an error and log it in MSSCW log file.

SCW command to register Exchange 2007 extension:
scwcmd register /kbname:Ex2007KB /kbfile:"%programfiles%\Microsoft\Exchange Server\scripts\Exchange2007_WinSrv2008.xml”

Error Message:

Command completed with error.
The parameter is incorrect.
Please check log file(s) under the following directory
%windir%\security\msscw\Logs

MSSCW Log file error:

0×80070057
The specified OS version does not match with the version that is defined in the KBRegistration.xml file. The parameter is incorrect.

Reason is SCW extension XML files are hardcoded to run on Windows 2008 with maximum of Service Pack 1 however we can change the value of ServicePackMajorVersion from 1 to 2 in the file to work with SP2.

Open SCW extension XML file in notepad and change it from:
<SCWKBRegistrationInfo OSMajorVersion="6" OSMinorVersion="0" ServicePackMajorVersion="1" ServicePackMinorVersion="0">

To:
<SCWKBRegistrationInfo OSMajorVersion="6" OSMinorVersion="0" ServicePackMajorVersion="2" ServicePackMinorVersion="0">

Blog at WordPress.com.