test
34.1 C
Dubai
Sunday, June 23, 2024

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
Award-winning Technology Leader with a wealth of experience running large teams and diversified industry exposure in cloud computing. From shipping lines to rolling stocks.In-depth expertise in driving cloud adoption strategies and modernizing systems to cloud native. Specialized in Microsoft Cloud, DevOps, and Microsoft 365 Stack and conducted numerous successful projects worldwide. Also, Acting as a 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