24.5 C
Dubai
Tuesday, December 6, 2022

How to Re-Create Powershell Virtual Directory in a Single Exchange Server Environment

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

image

Run

Get-PowerShellVirtualDirectory | Fl Server,Id*

Get the identity

image

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

image

Satheshwaran Manoharan
Satheshwaran Manoharanhttps://www.azure365pro.com
Specialized in Microsoft Azure - Office 365 / Microsoft Exchange; conducted numerous projects worldwide in designing, supporting, and implementing messaging and virtualization infrastructure for medium-sized and large enterprises. Further, I am a Cloud Architect and Technical Advisor for various start-ups.

Related Articles

9 COMMENTS

  1. 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?

  2. Hi,
    I have problem to run “New-PowershellVirtualDirectory” Cmdlet
    there is no Cmdlet like that in my server.
    what can i do?

  3. 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],

LEAVE A REPLY

Please enter your comment!
Please enter your name here

× How can I help you?