Solved

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

Posted on 2016-08-22
3
135 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 81

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

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

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

A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

728 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