Powershell & C# .net

Soldato
Joined
17 Jul 2005
Posts
3,193
Guys

I have been running a couple of powershell scripts via a C#.net aspx page largely succesfully - however most of these have been using credentials in the actual script.

I have one script that queries a list of terminal servers and outputs a couple of values. This worked fine in dev on my own local machine but when uploaded to the web server it returns a value of 0.

If I run the script on the web server (logged on as myself) it runs fine.

I presume this is because IIS runs the script under it's account.

Any ideas? What do I need to change?

Thanks
 
Still having problems :(

Have added;

<identity impersonate="true" password="password" userName="domain\username" />

...inside the <system.web. tags in the web config file and restarted IIS but no difference, the script still seems to return a 0 :O

This is IIS 7.0 running on Windows 2008 R2 64bit.

Any further ideas?
 
Last edited:
Back
Top Bottom