I removed the autodiscover virtualdirectory using the remove command. Because the autodiscover.xml file was empty.
When I want to recreate the virtualdirectory I get an error
[PS] C:\Windows\system32>New-AutodiscoverVirtualDirectory -WebsiteName "Default Web Site" -WindowsAuthentication $true -
BasicAuthentication $true
An error occurred while creating the IIS virtual directory 'IIS://servername/W3SVC/1/ROOT/Autodiscover' o
n 'TONHQMAIL'.
+ CategoryInfo : InvalidOperation: (servername\Autod...fault Web Site):ADObjectId) [New-AutodiscoverVirtua
lDirectory], InvalidOperationException
+ FullyQualifiedErrorId : 51BD160,Microsoft.Exchange.Management.SystemConfigurationTasks.NewAutodiscoverVirtualDir
ectory
[PS] C:\Windows\system32>