Forum Discussion
Exchnage 2019 on prem EMS not working. Recreating Exchange Virtual Directories failed
I have two exchange 2019 on prem in DAG. Recently EMS (Exchange management shell) on both servers stop working and I tried to delete and recreate on MAIL2 but unsuccessful.
Basically it return error that The AD configuration for virtual directory 'Powershell' already exists
I tried to delete first with Remove-PowerShellVirtualDirectory I tried clean up IIS and AD but still getting this error, even that in ADSI edit I delete all powershell objects for MAIL2
Exchange Health Checker:
beside that server is in maintenance mode, nothing interesting. just the last line: Default Web Site/PowerShell has authentication set, which is unsupported.
Error form PowerShell:
New-PowershellVirtualDirectory : The AD configuration for virtual directory 'Powershell' already exists in 'CN=Powershell (Exchange Back End),CN=HTTP,CN=Protocols,CN=MAIL2,CN=Servers,CN=Exchange Administrative Group
(FYDIBOHF23SPDLT),CN=Administrative Groups,CN=Company Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=rcompany,DC=local', please remove this AD configuration manually.
Parameter name: VirtualDirectoryName
At line:1 char:1
- New-PowershellVirtualDirectory -Name "Powershell" -Role "Mailbox" -Re ...
- CategoryInfo : InvalidArgument: (MAIL2\Powershell (Exchange Back End):ADObjectId) [New-PowerShellVirtualDirectory], ArgumentException
- FullyQualifiedErrorId : [Server=MAIL2,RequestId=2bb82483-c56a-4e4f-8d08-c81691b34bd1,TimeStamp=11/4/2025 2:31:50 PM] [FailureCategory=Cmdlet-ArgumentException] B318F342,Microsoft.Exchange.Management.SystemConfigurat
2 Replies
Hi,
The PowerShell (Exchange Back End) virtual directory already exists in Active Directory for server MAIL2. To recreate or reconfigure it, you’ll need to manually remove the existing AD entry before running the New-PowerShellVirtualDirectory command again.- Scott_SchnollCopper Contributor
See if this helps:
1. Open IIS Manager.2. Navigate to Default Web Site > PowerShell.
3. Click on Authentication in the right-hand menu.
4. Ensure that both Integrated and Basic Authentication are unchecked.
Do an iisreset if you change anything.