# Thread: Rebuilding Exchange 2007 IIS Default Web Site

1. ## Rebuilding Exchange 2007 IIS Default Web Site

I'm trying to find out if there is any commands or configuration that I can run to rebuild Exchange 2007 IIS Default Web Site configuration, this is where OWA is configured etc.

I was also curious if you remove Default Web Site, is there anyway to restore it? without uninstalling/reinstalling Exchange 07?

Thanks...

2.  -->
3. New-OWAVirtualDirectory -OwaVirtualDirectory -OWAVersion "Exchange2007" -Name "owa" -Website "Default Website"
New-OWAVirtualDirectory -OwaVersion:Exchange2003or2000 -VirtualDirectoryType Mailboxes -Name "exchange" -WebSiteName "Default Website"
New-OWAVirtualDirectory -OwaVersion:Exchange2003or2000 -VirtualDirectoryType PublicFolders -Name "public" -WebSiteName "Default Website"
New-OWAVirtualDirectory -OwaVersion:Exchange2003or2000 -VirtualDirectoryType Exchweb -Name "exchweb" -WebSiteName "Default Website"

4. Sweet Royal, this is very helpful Thanks!!! dang it I never saw this on the vids... was this on CBT?

5. Here's the command I was trying to test, it gives me an error.

New-OwaVirtualDirectory -ApplicationRoot "system.string" -DomainController "w2k3en32-s05.soggyrice.local" -OwaVersion "Exchange2007" -WebSiteName "default website"
At line:1 char:24+ New-OwaVirtualDirectory <<<< -ApplicationRoot "system.string" -DomainController "w2k3en32-s05.soggyrice.local" -OwaVersion "Exchange2007" -WebSiteName "default website"

The specified Domain Controller is infact my AD/DC FQDN.

6. Can you post the error?

7. Originally Posted by astorrs
Can you post the error?
The error is the 2nd line...

8. This is the correct command, and yes I succesfully run "remove-owavirtualdirector" cmdlet.

The WWW Publishing Service has been stopped priot to invoking this cmdlet.

Cmdlet:

New-OwaVirtualDirectory -ApplicationRoot "system.string" -DomainController "w2k3en32-s05.soggyrice.local" -OwaVersion "Exchange2007" -WebSiteName "Default Web Site"

Error:

New-OwaVirtualDirectory : An error occurred while creating the IIS virtual directory 'IIS://w2k3en64-s03.soggyrice.local/W3SVC/1/ROOT/owa' on 'W2K3EN64-S03'.
At line:1 char:24+ New-OwaVirtualDirectory <<<< -ApplicationRoot "system.string" -DomainController "w2k3en32-s05.soggyrice.local" -OwaVersion "Exchange2007" -WebSiteName "Default Web Site"

9. Sorry I missed that. All the PowerShell syntax kinda blurred together.

Others seem to have had the same problem. Can you double check that IIS isn't running in 32-bit compatibility mode?

To switch IIS to 64-bit mode from the command prompt run the following:

(I remembered this all started after you installed GFI MailArchiver, since it uses IIS it might have enabled it)

10. Originally Posted by jbaello
Sweet Royal, this is very helpful Thanks!!! dang it I never saw this on the vids... was this on CBT?
No this wasn't on CBT. I just know the PowerShell command New-OWAVirtualDirectory so I looked up the commands to rebuild the Exchange 2007 specific directories and the 2003 specific directories. There are other directories though such as Autodiscover and EWS, Etc...

For Autodiscover, you would do new-Autodiscovervirtualdirectory.

I don't see a new-ewsvirtualdirectory.

So not really sure what we'd do for that directory.

Edit: Just found this -
http://support.microsoft.com/default.aspx?kbid=320202

Apparently, you have to re-install IIS and then re-install the CAS role to get the Autodiscover/EWS(Availability) stuff going. You can then run the PowerShell commands at the bottom of the article on your Mailbox Server.

11. Originally Posted by royal
Originally Posted by jbaello
Sweet Royal, this is very helpful Thanks!!! dang it I never saw this on the vids... was this on CBT?
No this wasn't on CBT. I just know the PowerShell command New-OWAVirtualDirectory so I looked up the commands to rebuild the Exchange 2007 specific directories and the 2003 specific directories. There are other directories though such as Autodiscover and EWS, Etc...

For Autodiscover, you would do new-Autodiscovervirtualdirectory.

I don't see a new-ewsvirtualdirectory.

So not really sure what we'd do for that directory.

Edit: Just found this -
http://support.microsoft.com/default.aspx?kbid=320202

Apparently, you have to re-install IIS and then re-install the CAS role to get the Autodiscover/EWS(Availability) stuff going. You can then run the PowerShell commands at the bottom of the article on your Mailbox Server.
This is the most comprehensive approach in rebuilding Exchange 2007 IIS Components.

Thanks!!!

12. Originally Posted by royal
I don't see a new-ewsvirtualdirectory.

So not really sure what we'd do for that directory.
FYI, it's New-WebServicesVirtualDirectory with applicable MS linkage...

http://technet.microsoft.com/en-us/library/bb125176(EXCHG.80).aspx

13. Originally Posted by jbaello
Originally Posted by royal
Originally Posted by jbaello
Sweet Royal, this is very helpful Thanks!!! dang it I never saw this on the vids... was this on CBT?
No this wasn't on CBT. I just know the PowerShell command New-OWAVirtualDirectory so I looked up the commands to rebuild the Exchange 2007 specific directories and the 2003 specific directories. There are other directories though such as Autodiscover and EWS, Etc...

For Autodiscover, you would do new-Autodiscovervirtualdirectory.

I don't see a new-ewsvirtualdirectory.

So not really sure what we'd do for that directory.

Edit: Just found this -
http://support.microsoft.com/default.aspx?kbid=320202

Apparently, you have to re-install IIS and then re-install the CAS role to get the Autodiscover/EWS(Availability) stuff going. You can then run the PowerShell commands at the bottom of the article on your Mailbox Server.
This is the most comprehensive approach in rebuilding Exchange 2007 IIS Components.

Thanks!!!
This worked fine, except some cmdlets.

https://webmail.soggyrice.com/owa