Solved

Harder to call PowerShell from web application (ASP.Net)?

Posted on 2016-08-22
3
119 Views
Last Modified: 2016-09-08
A developer told me that it takes a lot more effort to program an ASP.Net C# web application to call PowerShell to query Active Directory & Windows using a service account (not the user's credentials) than to program a C# client-server application to do the same.  That doesn't seem very intuitive to me.  Can you all confirm or disagree?  Thanks!
0
Comment
Question by:humbleamateur
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 80

Accepted Solution

by:
David Johnson, CD, MVP earned 250 total points
ID: 41766178
since the Website is using C# .net why don't you code it in the code behind? Everything you can do in powershell can be done in C#.  It seems counter-intuitive to have to start a new process (powershell), pass the variables,run the script and then return the results. You don't need a client/server c# app though it can be done that way.
1
 
LVL 30

Assisted Solution

by:MlandaT
MlandaT earned 250 total points
ID: 41766235
I agree with David. Here are some examples to get you started..

http://ianatkinson.net/computing/adcsharp.htm
https://msdn.microsoft.com/en-us/library/ms973834.aspx
http://www.macaalay.com/2010/06/28/active-directory-c/

You'll be able to get tonnes of examples of how to accomplish various tasks in AD using C#. No need for PowerShell
0
 

Author Closing Comment

by:humbleamateur
ID: 41790695
Thanks so much!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question