Microsoft Exchange Server

Exchange 2007: OWA Virtual Directories from PowerShell

Get a list of all of your virtual directories from PowerShell using this command:

Get-OwaVirtualDirectory

If you are having an issue with a specific virtual directory then you can delete it using this command:

Remove-OwaVirtualDirectory “owa (Default Web Site)”

In the above command we used owa but we could have also used Exchange, Public, Exchweb or Exadmin.  To recreate the directory use the following command (again replacing owa in the “” portion of the command with the specified virtual directory you are recreating:

New-OwaVirtualDirectory -OwaVersion “Exchange2007″ -Name “owa (Default Web Site)”

Because Exchange, Public, Exchweb and Exadmin are not native to Echange 2007 then you would actually replace Exchange2007 with Exchange2003or2000.  So if you wanted to recreate Exadmin you would use the following command

New-OwaVirtualDirectory -OwaVersion “ Exchange2003or2000″ -Name “Exadmin (Default Web Site)”