Lets see how to recreate a Powershell Virtual Directory in a Single Exchange Server Environment.
Note : Do not do this if you have multiple Exchange Servers in the Environment. As you might end up with an Error – Powershell already Exists
At times we had to recreate this Power shell virtual Directory when it goes corrupted or when wrong customizations done and you might end up in a Exchange Management Console issue. So recreating will be the last option.
Before Proceeding – Make sure you are able to run “New-PowershellVirtualDirectory” Cmdlet – Type “New-Po” and Then press your TAB key it should resolve your command
Step 1:
Run
Get-PowerShellVirtualDirectory
make sure it Returns the Existing PowerShellVirtualDirectory
Run
Get-PowerShellVirtualDirectory | Fl Server,Id*
Get the identity
Step 2:
Run
Remove-PowerShellVirtualDirectory "Exchange2010\PowerShell (Default Web Site)"
Press Yes
Step 3:
Run
New-PowerShellVirtualDirectory -Name Powershell -RequireSSL:$False
Then,Run iisReset in Cmd prompt to refresh things
Browsing the PowershellWebsite should give you 401.0 Access Denied –(Default)
Powershell Default Page
Good One.
Thanks Sunder !
I ran into an issue creating the virtual directory as described. I get an error stating the following:
New-PowerShellVirtualDirectory : An error occurred while creating the IIS virtual directory ‘IIS://servername.domain.local/W3SVC/1/ROOT/PowerShell’ on ‘server’.
New-PowerShellVirtualDirectory -Name PowerShell -RequireSSL:$False
CategoryInfo : InvalidOperation: (server\P…fault Web Site):ADObjectId) [New-PowerShellVirtualDirectory],
and so on.
Any suggestions?
Hi Mike,
You can installed IIS Metabase tools and Remove the powershell from there and Try Creating it again. That would help.
Make sure you take a IIS back up before doing it . !!
Make sure its valid for your OS version and stuffs.
http://www.microsoft.com/en-us/download/details.aspx?id=17275
Hi,
I have problem to run “New-PowershellVirtualDirectory” Cmdlet
there is no Cmdlet like that in my server.
what can i do?
what OS you are using ? R2 or 2008 ?
Thanks so much!
Great Job! Work fine
Thanks Alisson
i follow 1 to 3 steps. but now i m not able to create powershell in iis.
Same error i m getting. Any suggestions?
New-PowerShellVirtualDirectory : An error occurred while creating the IIS virtual directory ‘IIS://servername.domain.local/W3SVC/1/ROOT/PowerShell’ on ‘server’.
New-PowerShellVirtualDirectory -Name PowerShell -RequireSSL:$False
CategoryInfo : InvalidOperation: (server\P…fault Web Site):ADObjectId) [New-PowerShellVirtualDirectory],