system.diagnostic.process Error Output

P

Paul Bergson

I have been trying to get a process to start up and run with arguments
passed to it. I have gotten close (Thanks to help from this board) but I
there is a failure while I'm running this because the c:\bin\xcacls starts
nothing happens.

How can I see output from the console i was trying to get the
ProcessStartInfo.RedirectStandardOutput Property to work but even if I got
the system to process it I didn;t know where the output was being sent. I'm
in over my head but hoping to try and get this to run.

Anybody know what I can do to get this to give me the output?


<%@ Page Language="vbscript" Debug="true" %>


<script runat="server">
Sub submit(sender As Object, e As EventArgs)

Dim csc As System.Diagnostics.Process = New System.Diagnostics.Process()
csc.StartInfo.FileName = "c:\bin\xcacls"
csc.StartInfo.Arguments = "c:\blaster /G GOB\pbergson:F /Y"
csc.Start()

End Sub
</script>

<html>
<body>
<form runat="server">
<asp:Button OnClick="submit" Text="Submit" runat="server" />
<p><asp:Label id="lbl1" runat="server" /></p>
</form>
</body>
</html>

Thank-You
 
P

Paul Bergson

Not sure who the user is, think it is admin from my server settings. When I
run task manager I see the process fire and the user name is "Network
Service." This is even if I use the account impersonation. I get the same
thing happening either way.

If I don't pass any arguments the job shows up on the task manager and just
sits there until I kill it. If I pass it arguments then the job acts like
it runs but the job doesn't show up in the task manager. But the job hangs
in a dos command if no arguments are supplied, so I'm assuming the job
thread is trying to tell me it needs data and then is waiting for a response
to the error. But I don't know if that is why.

Is there any way I can see what is happening on this thread for output?
 
S

Steve C. Orr [MVP, MCSD]

Oh, you must be running Windows 2003. Network Service is the default
account that is used and it is not an Administrator level account by default
and probably doesn't have permission to access the file.
It sounds like it's working with impersonation as long as you pass it the
parameters it expects, so what is the problem?
 
P

Paul Bergson

Microsoft in their infinite wisdom gave no easy way to manage access rights.
I used to be a developer but traded in my coding apron for a networking
apron. There are probably ways to manage rights with C or some other
language but forget trying to do it easily with a scripting language. I
need to create a mail enabled user in AD and create a multiple folder
hierarchy for any new user for the system. The folders have different ACL's
for each folder and sub-folder. This window has to be able to be run by
unprivileged help desk personnel.

What I have ended up doing is writing a asp page with some vb script that I
can get everything to work except set the permissions. When I call the
Resource kit program XCACLS.exe it will fire off but the parameters don't
seem to be getting passed correctly. I never get them to work. So I'm
doing something wrong but I can;t get any error messages back to see what it
doesn't like.

What I want to see is the output from the request.

I'm stumped and like I said I'm over my head because I have gotten to the
point of guessing (I have a day of time or more in on this when it should
probably take someone who knows what they are doing 10 minutes).

--

Paul Bergson MCT, MCSE, MCSA, CNE, CNA, CCA

This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Paul Bergson

I thought about this and decided to make the network service a local admin
and pointed the xcacls at a local file. That worked.

So...................

How can I get a spawned process to impersonate an id. Is this what you sent
me last time and I haven't installed it properly?

Here is what I have in my web.config that resides at the root of my web
site. filerAdmin is a domain account that has full rights on a Linux Box (A
NetApps Filer if you are familiar with them).

<configuration>

<system.web>

<authentication mode="Windows" />

<identity impersonate="true"
userName="gob\filerAdmin" password="xxxxxxxx"/>

</system.web>

</configuration>


--

Paul Bergson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top