Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I've created a project that manages Active Directory and Exchange. Right now each command is opening a new runspace for remote powershell and each command that talks to Active Directory is opening a new connection as well. So when it is finished it will close the connection and properly dispose of it.


For performance reasons I'm wondering if there is a better way of doing this? Such as opening the AD connect and Powershell connection in the global.asax when the application starts and closing it when the application stops. I'm thinking I could store the data in a session variable and retrieve it when needed and this way I keep a constant connection open each time and thus hopefully increase the performance.

Would this be a horrible idea or maybe someone has a better way of doing this in ASP.NET?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900