Get-MailboxDatabase oneliner

If you run the Get-MailboxDatabase commandlet with no switches it returns all the Exchange 2007 databases in the organization. If you are looking for a list of when each database had a full backup you need to use the -Status switch.

Get-MailboxDatabase -Status | Sort -Property LastFullBackup |ft Identity,LastFullBackup

This will return the Identity and the time for the last full backup of each database in sorted order. This is a useful list when doing maintenance in an Exchange organization.

If you need  a quick powershell script that dumps each Storage Group and its backup-related information visit the Exchangepedia Blog at: http://exchangepedia.com/blog/2008/09/script-get-storage-group-backup-status.html

How to enable Outlook Anywhere on Exchange 2007

Here is a great article on enabling, verifying and troubleshooting Exchange Outlook Anywhere http://www.exchange-genie.com/2008/02/configuring-outlook-anywhere-for-exchange-2007-sp1/

See this articel for publishing Outlook Anywhere with ISA Server 2006 http://www.msexchange.org/tutorials/Outlook-Anywhere-2007-ISA-Server-2006.html

Outlook Anywhere Troubleshooting Guideline

Collect info:

Is it a testing environment?
Is the testing client located in the domain when you tested it?
Where did you get the certificate for outlook anywhere, Microsoft CA?
Did you create CNAME record for your exchange server’s external hostname? If the external hostname is set differently with the FQDN of the exchange server

The steps to enable outlook anywhere:

  1. Enable outlook from EMC, I suppose you’ve already done that.
  2. Add certificate to “Default Web Site” in IIS. 
    1. Note the values of the “Subject” and “Subject Alternative Name” fields Right-click “Default Web Site”->”Directory Security”->”View Certificate” button“Details” tab->check those fields
    2. Notes: “Subject” shall be the same one as your external hostname
  3. Check “RPC” Virtual Directory in IIS
    1. Launch IE
    2. Enter URL https://servername/rpc
    3. It shall prompt for credential, cancel it
    4. The content of webpage shall only contain the words “Error: Access is Denied”
  4. Try to create mail profile for test user in the domain at first
    1. Notes: After autodicover mail profile has been created, go to the setting window of “Outlook Anywhere”, and check the “On fast networks, connect using HTTP first…”
      Check if outlook anywhere is working in the “Connection Status”

For verifying RPC connectivity

  • Launch cmd
  • Testing RPC Proxy Server [rpcping -t ncacn_http -s ExchServer -o RpcProxy=RPCProxyServer -P “user,domain,*” -I “user,domain,*” -H 1 -u 10 -a connect -F 3 -v 3 -E -R none]
    • Notes: It will prompt for password for exchange server first, and the password for RPCProxyServer
    • Notes: RPC Proxy Server will be your Client Access Server [CAS], does the CAS role and MBX role stay on one box?
  • Testing backend port
    • For store: RpcPing –t ncacn_http –s ExchangeMBXServer -o RpcProxy=RpcProxyServer -P “user,domain,password” -I “user,domain,password” -H 1 –F 3 –a connect –u 10 –v 3 –e 6001
    • For DSProxy: RpcPing –t ncacn_http –s ExchangeMBXServer -o RpcProxy=RpcProxyServer -P “user,domain,password” -I “user,domain,password” -H 1 –F 3 –a connect –u 10 –v 3 –e 6004

Wrong version number on Exchange 2007 mailbox

I had a problem with a migrated user from Exchange 2003 to Exchange 2007 not showing the correct version number. It was not listed as Legacy Mailbox and it resided on a Exchange 2007 store. Running the get-mailbox command I saw that the version number on the mailbox was 0.0 and not 0.1 for Exchange 2007. Because of the mailbox being in this state the user could not connect to OWA. I got the following message:

Inner Exception
Exception type: Microsoft.Exchange.Data.Directory.InvalidADObjectOperationException
Exception message: Property Languages cannot be set on this object because it requires the object to have version 0.1 (8.0.535.0) or later.
Current version of the object is 0.0 (6.5.6500.0).

To resolve this problem you need to correct the properties of the mailbox. Do this by running  the following commandlet  in Exchange Management Shell:

Set-Mailbox -Identity <user> -ApplyMandatoryProperties

View KB 931747 article over at Microsoft Support, http://support.microsoft.com/kb/931747

Web Services InternalURL powershell configuration

If you are using a loadbalancer in front of the ClientAccess server or want to reconfigure the internal URL to point to http and not https you need to reconfigure a couple of services with the correct url so that autodiscover functions properly. To do so I have created a simple script to ease the process using powershell. The script does the following:

  • The server path is specified in the variable
  • Then we use -identity * if you have more than one instance you need to specifiy wich instance you want to configure
  • The url is generated using the variable and the default location of the services files
  • After reconfiguring the services we do a test of the connectivity to verify the configuration
  • Note that custom user credentials is used so that default credentials is not nessesary
  • OWA internal url has to be set manually

To run the script do the following:

  • Copy this into a txt file and rename it to a ps1 file
  • Navigate to the location where the file is saved
  • Use tab to get the correct run syntax

NOTE: This script has been updated in a post related to Exchange 2010 here: https://msunified.net/2010/01/13/configure-exchange-2010-internalurl-powershell-script/

$urlpath = "http://exchange-server.yourdomain.com"

Set-AutodiscoverVirtualDirectory -Identity * –internalurl “$urlpath/autodiscover/autodiscover.xml”
Set-ClientAccessServer –Identity * –AutodiscoverServiceInternalUri “$urlpath/autodiscover/autodiscover.xml”
Set-webservicesvirtualdirectory –Identity * –internalurl “$urlpath/ews/exchange.asmx”
Set-oabvirtualdirectory –Identity * –internalurl “$urlpath/oab”
Set-ActiveSyncVirtualDirectory -Identity * -InternalUrl "$urlpath/Microsoft-Server-ActiveSync"

Test-WebServicesConnectivity -MailboxCredential (Get-Credential <Netbios domain name>\<username>) -TrustAnySSLCertificate
Test-activesyncConnectivity -MailboxCredential (Get-Credential <Netbios domain name>\<username>) -TrustAnySSLCertificate

Configuring custom email address policies using powershell

If you want to configure email address policies with custom setting you need to do this by using powershell. Here you see an example where the reply e-mail address is set to a custom address. The template used below changes spaces in given names and surenames to “.”. This gives the user with the name of Martin Steven Williams the email address of Martin.Steven.Williams@msunified.net.

By typing smtp with capital letters the system sets this address as the primary smtp address. Additional addresses should have smtp as shown below

Set-EmailAddressPolicy -Identity “Default Policy” -EnabledEmailAddressTemplates SMTP:”%r .%g.%r .%s@msunified.net”, smtp:%m@msunified.net

 

This can be expanded upon by replacing and converting nordic characters to compatible character like this: “%r .%råa%ræa%røo%rÆA%rÅA%rØO%g.%r .%råa%ræa%røo%rÆA%rÅA%rØO%s@msunified.net”

Changing the Queue Database path in Exchange Server 2007

Any Post starting with this disclaimer means that this post was not written by me however I liked it and added to my blog. I will also include the link to the original or similar post to provide credit to the original author

http://msmvps.com/blogs/andersonpatricio/archive/2007/06/12/changing-the-queue-database-in-exchange-server-2007.aspx

If you do a default installation of Exchange 2007 the queue database config is located in “C:\Program Files\Microsoft\Exchange Server\Bin\EdgeTransport.exe.config” and the database is stored under “C:\Program Files\Microsoft\Exchange Server\TransportRoles\data\Queue\” as default.  To change this settings, we should open the file EdgeTransport.exe.config in this file we have to parameters:

  • QueueDatabasePath: Database path (mail.que and trn.chk files)
  • QueueDatabaseLoggingPath: transaction logs path (*.log and *.jrs files)

Now, let’s change both parameters for the c:\Database folder, as shown in the figure below. 


Click on the image to see in the original size (readable)

After changing the config file, we have to methods do accomplish our queue database moving process:

Moving the current database

  1. Click on Start / Run and type services.msc  click OK
  2. Stop the service called Microsoft Exchange Transport
  3. Move the database files(mail.que and trn.chk) from original location to the new place
  4. Move the transactions log files (*.log and *.jrs) from original location to the new place 
  5. Start the Microsoft Exchange Transport service

Creating a new queue database

  1. Click on Start / Run and type services.msc  click OK
  2. Restart the the Microsoft Exchange Transport service

In both cases the result will be the same, the new database will be changed for the directory specified in the .config file.