Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Help: OWSADM hangs when executing from C# web service

Reply
Thread Tools

Help: OWSADM hangs when executing from C# web service

 
 
Abhi
Guest
Posts: n/a
 
      05-23-2005
Hi-

I'm trying to execute the C:\Program Files\Common Files\Microsoft
Shared\Web Server Extensions\50\bin\OWSADM.EXE programmatically from a
shell using the process.Start() method. I'm also impersonating as the
admin user and providing the login credentials through the
process.StartInfo.UserName and process.StartInfo.Password attributes.
I'm using ASP.NET 2.0 Beta 2.

Process process = new Process();
process.StartInfo.FileName = @"C:\Program Files\Common
Files....\OWSADM.EXE";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;

process.StartInfo.Arguments = "-o install -p /LM/W3SVC/" + MyWebDir +
@" -u Admin"

process.StartInfo.UserName = "<Admin Name Here>";
process.StartInfo.Password = ConvertToSecureString("<Admin Password
Here>");
process.Start();
process.WaitForExit();
string output = process.StandardOutput.ReadToEnd();
string error = process.StandardError.ReadToEnd();


I've implemented ConvertToSecureString my self to convert a string into
a SecureString

private SecureString ConvertToSecureString(string str)
{
SecureString secureString = new SecureString();
foreach (char c in str)
{
secureString.AppendChar(c);
}
return secureString;
}


For some reason when I execute the Start() method then the OWSADM hangs
in memory. It does not return any error code or any other output. If I
provide an invalid password then it complains about login failures.

The same command works fine if I choose to run it directly from the
command prompt on that machine. However it does not run from my C# web
method.

The machine is running Windows Server 2003 Enterprise edition. (3.06
GHz, 4 GB of RAM!)


Note: When looking at the hung process"OWSADM" using Process Explorer I
see that there's this KeyedEvent
"\KernelObjects\CritSecOutOfMemoryEvent"

Any help will be greatly appreciated.
Thanks!
-abhi

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Does timer in Web Service Global.asax block my Web Service from processing web-site requests? Leo Violette ASP .Net Web Services 0 04-17-2009 12:39 AM
Ruby hangs when executing a another program Christopher Rasch Ruby 2 08-01-2006 03:25 AM
InvocationTargetException when calling "new Service()" in Axis web service to call another web service Michael Averstegge Java 0 01-10-2006 11:05 PM
Gem hangs => TCPSocket.write hangs Tim Shadel Ruby 1 07-24-2005 06:11 AM
Clear hangs up - & hangs up - & hangs up Sue Bilstein NZ Computing 26 03-07-2004 01:33 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57