Powershell to Set Exchange 2007 Mailbox Quota limit to UNLIMITED

Some times there may be a necessary that you may have to set mailbox quota prohibitsendandreceive to unlimited. Some users may be very important person and you need to set UNLIMITED to atleast receive emails.

$username = <username>

Set-Mailbox $username -UseDatabaseQuotaDefaults:$False -issuewarningQuota 90MB -ProhibitSendQuota 100MB -ProhibitSendReceive “UNLIMITED”

This is to set explicity for a user, if you want to send similar setting to multiple people then you have have to loop it and apply the same or

get-content “C:\names.txt” | Set-Mailbox  -UseDatabaseQuotaDefaults:$False -issuewarningQuota 90MB -ProhibitSendQuota 100MB -ProhibitSendReceive “UNLIMITED”

get-content “C:\names.txt” | Set-Mailbox  -UseDatabaseQuotaDefaults:$False -issuewarningQuota “UNLIMITED” -ProhibitSendQuota “UNLIMITED” -ProhibitSendReceive “UNLIMITED”

VBSCript to Send mail using CDO with Delivery and Read Recipient enabled

Below is the Procedure to send mail using CDO with Delivery and Read Recipient Enabled
Sub TestmailusingCDO_SMTP()
set objMsg = CreateObject(“CDO.Message”)
set objConf = CreateObject(“CDO.Configuration”)
Set objFlds = objConf.Fields
 
 With objFlds
  .Item(“http://schemas.microsoft.com/cdo/configuration/sendusing“) = 2
  .Item(“http://schemas.microsoft.com/cdo/configuration/smtpserver“) = “SMTPServername”
  .Update ‘ Save
 End With

strBody = “This is a Test email.” & vbCRLF & vbCRLF & “—————————”

 With objMsg
  Set .Configuration = objConf
  .To = “<valid email addres>”
  .From = “<valid email addres>”
  .Subject = “Testing Email ” & Date()
  .TextBody = strBody ‘ Use .HTMLBody to send a HTML e-mail
  .Fields(“urn:schemas:mailheader:disposition-notification-to”) = “<valid email addres>”
  .Fields(“urn:schemas:mailheader:return-receipt-to”) = “<valid email addres>”
  .DSNOptions = cdoDSNSuccessFailOrDelay
  .Fields.update ‘ Save
  .Send
 End With

 

End Sub

Powershell Command to Export User mailbox Propertes

Below Powershell command can be used to export the list of mailboxes properties like DisplayName, totalItems,ItemCount for the list of users given in a text file to a export to a csv file

Get-Content “C:\name.txt” | Get-Mailbox | Get-MailboxStatistics | Select DisplayName,TotalItemSize,ItemCount| Export-Csv c:\MailboxStatistics.csv
Get-Content “C:\name.txt” | Get-Mailbox | Get-MailboxStatistics | Select DisplayName,{$_.TotalItemSize.Value.ToMB()},ItemCount| Export-Csv c:\MailboxStatistics.csv
Get-Content “C:\name.txt” | Get-Mailbox | Get-MailboxStatistics | Select DisplayName,{$_.TotalItemSize/1.0MB},ItemCount| Export-Csv c:\MailboxStatistics.csv
Get-Content “C:\name.txt” | Get-Mailbox | Get-MailboxStatistics | Select DisplayName,{$_.TotalItemSize.Value.ToGB()},ItemCount| Export-Csv c:\MailboxStatistics.csv

Converting Exchange 2007 Mailbox

You can convert mailbox from one type to other type in two ways

1. Throught Powershell command

     Set-Mailbox <mailboxname> – Type <type>

     Type can be Regular, Room, Equipment, Shared

2.  Second option is throught Editing Value of msExchRecipientTypeDetails  from ADSIEDIT.

      Access user properties throught ADSIEDIT and find the attribute msExchRecipientTypeDetails change values. Values for Different mailboxes is given below

     User Mailbox : 1
     Linked Mailbox : 2
     Shared Mailbox :4
     Legacy Mailbox :8
     Room Mailbox   : 16
     Equipment Mailbox :13

OWA is not working for a User after migrating to Exchange 2007

When users Logs into OWA 2007, he gets below exception error

Exception

Exception type: Microsoft.Exchange.Data.Storage.StoragePermanentException

Exception message: There was a problem accessing Active Directory.

Solution

  1.  Open user properties in Active Directory Users and computer -> Click on Security Tab -> Advanced Button -> make sure that “Allow Inheritance.. ” Is checked

      2.  Check the user properties in Exchange management console , if Recipient Type Details is showing as legacy mailbox then run the following command in the exchange powersehll Set-Mailbox–ApplyMandatoryProperties –Identity <username>

EmailAddresspolicy When migrating users from Exchagne 2003 to Exchagne 2007

If you are migration from Exchagne 200x to Exchagne 2007 if you have Email policy with mulitple domains listed in the Exchange address tab and if you Primary smtp is not same as the DefaultEmail policy then once the mailbox is moved then you primary smtp address will get changed to email address which is set throught Defaultemail policy. The simple solution is you need to make sure that -EmailAddresspolicy should be disabled before you move the mailbox. This solves the problem.

$UserList = Get-Content “PathofTextfilecontactingusernames”
foreach($user in $UserList)
{
set-Mailbox $user -EmailAddressPolicyEnabled $false

}