Link to home
Start Free TrialLog in
Avatar of Alex Le
Alex Le

asked on

Cannot re-create PowerShellVirtualDirectory Exchange 2010 after deletion

I had this question after viewing Exchange Server 2010 - Error to recreate Powershell Virtual Directory.

I got the same problem, I followed the guidance in that topic but I cannot see the web.config created in the folder C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\PowerShell. Then I checked by run the Get-PowerShellVirtualDirectory to make sure this folder can be recognized by system but it seemed that it wasn't. Please see the pic attached.
Capture.PNG
Avatar of Systech Admin
Systech Admin
Flag of India image

Please try to run this command via Exchange Management Shell and share the output. Please run EMS as administrator
Avatar of Alex Le
Alex Le

ASKER

Hi Gaurav,

Thank for your help. I have followed your guidance but whenever I open EMS, it could not connect to server (see the pic attached). I had got this problem some weeks ago before I deleted Power Shell Virtual Directory to troubleshoot the case.

I tried go on typing the command Get-PowerShellVirtualDirectory and it came up with the error like the pic attached shows.
Error1.PNG
error2.PNG
Do you have the correct RBAC on the exchange?  from the screenshot, I can see that your exchange environment is having issues.
Avatar of Alex Le

ASKER

Hi Gaurav,

I am not sure about the RBAC correct or not, but  I am logging in as Administrator to carry out the commands, do you have any advice more?
Can you check the Active Directory for the permissions for the account you logged and you can share the screen shot of the membership of the administrator account. I tried to connect you via Session sharing feature of EE.
Avatar of Alex Le

ASKER

Hi,
I am logging with Administrator account as pics.
I have seen the session Sharing feature on my portal anywhere.
Capture1.PNG
Capture2.PNG
Avatar of Alex Le

ASKER

Hi ITGuy565,

Thank for you response. I had followed the link you sent before I raised the question here. After removing the PowerShell Directory , I coud not re-create it, and that's why I was here for the topic.
Try this:
1. Open IIS console
2. For Default Web Site, Add a new Virtual Directory.
 a) Alias: PowerShell
 b) Path: C:\Program files\Microsoft\V14\Exchange Server\ClientAccess\PowerShell.
3. Open Basic Settings of new Virt Dir and make sure the Application Pool is set to: MSExchangePowerShellAppPool.
4. If PowerShell-Proxy is missing as well then add another Virtual Directory.
 a) Alias: PowerShell-Proxy
 b) Path: C:\Program files\Microsoft\V14\Exchange Server\ClientAccess\PowerShell-Proxy.
5. Open Basic Settings of new Virt Dir and make sure the Application Pool is set to: MSExchangePowerShellProxyAppPool.
6. Turn off requirement for SSL.
Avatar of Alex Le

ASKER

Hi Peter,

Thank for your support.
I did follow that way and I got the error as the file shown.
Let me describe the nature of system briefly.
  - It is Hybrid Exchange, mailboxes has been migrated to O365 for long time ago.
  - We  would often use EMC to set control on mailboxes, EMC is used to have 2 sections of on-premise and O365 on that.
  - One day, the On-premised initialized fail and I tried to connect again by doing some troubleshooting.
  - I have been following the way of re-creating Powershell Directory and have been stuck on here.

Let me know if you need more info to have more advice for the next step.

Alex Le
error.docx
SOLUTION
Avatar of Peter Hutchison
Peter Hutchison
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Alex Le

ASKER

Hi Peter,

I did run the command. It said there's already the folded. However, I can not see anything from Get- .. command. Please see the pic attached.
Capture.PNG
Avatar of Alex Le

ASKER

Hi Peter,

I have just remove the folder by manually on IIS and re-created but it appeared an error like pic shown
Capture.PNG
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Well, this is a simple way to do it...

go to the server
Open powershell console as Administrator and then run:

#To enable exchange server commands on the server so you can actually run the New Psv...
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010; 
New-PowershellVirtualDirectory -Name Powershell -InternalUrl "https://www.res.local/powershell"

Open in new window