Question : Exchange 2010 EWS Virtual Directory

Problem regarding EWS Vdir in IIS of Exchange 2010.

Working as an IT-Consultant and at the current customer we are setting up exchange 2010 in a new domain.
Everything has been set up correctly and Exchange 2010 was up and running in our test environment until recently.
Due to a small test of EWS virtual directory in IIS we screwed this up pretty badly... As an action we would need to recreate the EWS Vdir, but heres the problem:

Using the EMS and trying to Remove the EWS Vdir, the EMS tells us:

[PS] C:\Windows\system32>Remove-WebServicesVirtualDirectory -Identity "ExchangeServerName\ews (Default Web Site)"
The operation couldn't be performed because object 'ExchangeServerNamee\ews (Default Web Site)' couldn't be found on 'DomainController.domainname.com'.
    + CategoryInfo          : NotSpecified: (0:Int32) [Remove-WebServicesVirtualDirectory], ManagementObjectNotFoundException
    + FullyQualifiedErrorId : E6F4FE0F,Microsoft.Exchange.Management.SystemConfigurationTasks.RemoveWebServicesVirtualDirectory




But when we try to create Vdir in EWS we get the following message:

[PS] C:\Windows\system32>New-WebServicesVirtualDirectory -path "C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\exchweb\EWS" -InternalUrl "https://webmail.domainname.com/ews/exchange.asmx" -ExternalUrl "https://webmail.domainname.com/ews/exchange.asmx" -WindowsAuthentication $true -WSSecurityAuthentication $true
The virtual directory 'EWS' already exists under 'ExchangeServerFQDN/Default Web Site'.
Parameter name: VirtualDirectoryName
    + CategoryInfo          : InvalidArgument: (ExchangeServerName\EWS (Default Web Site):ADObjectId) [New-WebServicesVirtualDirectory], ArgumentException
    + FullyQualifiedErrorId : 7824EE63,Microsoft.Exchange.Management.SystemConfigurationTasks.NewWebServicesVirtualDirectory

Basically the domaincontrollers are able to find the EWS Vdir if we try to create it, but if we try to remove it they cannot find it...

I remember this happened last yesterday when i tried to recreate the EWS Vdir. Yesterday i remove the EWS Vdir and created it again (New-WebServicesVirtualDirectory), and it gave me an error saying that it already exists.

When trying to obtain information of the EWS Vdir in EMS it shows the following:
[PS] C:\Windows\system32>Get-WebServicesVirtualDirectory
[PS] C:\Windows\system32>


Additional Information: EWS is up and running on the IIS 7 and "seems" to be working (no error messages in the application or Event Viewer when administrating ews in IIS), all the other objects (ecp, autodiscover etc, etc.) under IIS are working fine, as they should.

The DNS, DC:s, Web Configs, replication, everything is working FINE, only thing I need help with is how I can recreate EWS Vdir...


-I have tried reinstalling the Cas Role on our Exchange 2010 = Same Result
-Have tried using appcmd (in inetsrv folder) using cmd to recreate the ews vdir = Same Result
-Have tried using ADSIEDIT (with no success, if someone knows specificly what to delete/edit here regarding ews vdir please do tell :) )
-Have tried importing modules to the server 2k8 powershell for commands Import-Module servermanager, $module = Get-Module servermanager, $module.ExportCmdlets (the exchange 2010 is on a windows 2008 server with sp2)

Reinstalling the IIS or reinstalling the whole exchange 2010 is NOT an option...

Further Information: We are using Outlook 2007 and the client (and OWA) are working fine, though when using connection status of an Outlook 2007 client it cannot lcoate any directorys...

A solution or any small piece of information leading towards the solution is extremly much appreciated...

Best Regards,

/Juuso

Answer : Exchange 2010 EWS Virtual Directory

This issue can be closed, I have resolved it.

Resolution:
1. Remoting on to the root domain controller with all the FSMO roles
2. Open Adsiedit and open the following "Configuration" and the name of the DC with FSMO roles, after that choose connect
3. Navigate to the following: CN=Configuration, DC=dommainname, DC=com -> CN=Services -> CN=domainname -> CN=Administrative Groups -> CN=Exchange Administrative Group (FYDIBOHF23SPDLT) -> CN=Servers -> CN=Netbios name of the exchange server -> CN=Protocols -> CN=HTTP
4. Here we have most of the data objects that iis (the iis on the exchange server) writes to Active Directory, in our case the whole EWS was missing here.
I am most likely sure this occoured when we just tried to recreate webservicesvirtual directory from the EMS (remove-webservicesvirtual directory / new-webservicesvirtualdirectory).
5. Creating a new dataobject here (msExchWebServicesVirtualDirectory), when creating this object all the mandatory attributes should be written in this data object by default, if not then add them manually. You might need to configure some of the optional attributes as well ( if someone needs to know they can send me an mail or I can post them here when i have time)
6. After this we get a WebServicesVirtualDirectory from EMS (though its a base one, from scratch in other words we need to configure it now but atleast we get it =)  )

Regards,

/Juuso
Random Solutions  
 
programming4us programming4us