Exchange 2010 SP1 or SP2 trouble with: The virtual directory 'PowerShell' already exists
Microsoft Exchange 2010 SP1 & SP2
Issue:
The following error was generated when "$error.Clear();
$vdirName = "PowerShell";
$InternalPowerShellUrl="http://" + $RoleFqdnOrName + "/powershell";
new-PowerShellVirtualDirectory $vdirName -InternalUrl $InternalPowerS
ellUrl -DomainController $RoleDomainController -BasicAuthentication:$false -Win
owsAuthentication:$false -RequireSSL:$false;
" was run: "The virtual directory 'PowerShell' already exists under 'US
LTEXMB01.epri.com/Default Web Site'.
Parameter name: VirtualDirectoryName".
This typically occurs after trying to fix an SP2 or SP1 install/update that went wrong.
- On the offending Exchange Server open ADSIEDT.
- Click on Action and select “connection”.
- Select “Configuration” from the drop down in the “Connection Settings” dialog.
Diagram 1
-
Navigate to:
- CN=Configuration,DC=domain,DC=suffix
- CN=Services
- CN=Microsoft Exchange
- CN=[your domain]
- CN=Administrative Groups
- CN=Exchange Administrative Groups
- CN=Servers
- CN=[your server]
- CN=Protocols
- CN=HTTP
- Find the (in the right pane) CN=Powershell (Default Web Site), CN=HTTP… and delete it.
Diagram 2
-
Open the registry editor and navigate to
- KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\v14\MailboxRole
- Find the “Action” key and delete it.
Diagram 3
-
Navigate to: (Shown in diagram 3)
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SessionManager
- Locate the “PendingFileRenameOperations” key and delete it.
Diagram 4
- Restart the setup fromnthe command line as shown in digram 4. NOTE: in my example I am using the:
Setup.com /mode:uninstall /roles:mailbox
- You may be using:
Setup.com /mode:install /roles:mailbox for an install or upgrade, in my case I was uninstalling the server.
Diagram 5