Help: OWSADM hangs when executing from C# web service

Discussion in 'ASP .Net Security' started by Abhi, May 23, 2005.

  1. Abhi

    Abhi Guest

    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
    Abhi, May 23, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DaberElay
    Replies:
    0
    Views:
    197
    DaberElay
    Jun 27, 2004
  2. Jim Stallings

    stepping through web service hangs in VS

    Jim Stallings, Feb 15, 2005, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    115
    Keenan Newton
    Feb 16, 2005
  3. Gary W. Smith

    Web Service randomly hangs when being called from SOAP::Lite

    Gary W. Smith, Aug 4, 2009, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    876
    Gary W. Smith
    Aug 4, 2009
  4. Tim Shadel

    Gem hangs => TCPSocket.write hangs

    Tim Shadel, Jul 23, 2005, in forum: Ruby
    Replies:
    1
    Views:
    367
    Ville Mattila
    Jul 24, 2005
  5. Christopher Rasch

    Ruby hangs when executing a another program

    Christopher Rasch, Jul 31, 2006, in forum: Ruby
    Replies:
    2
    Views:
    105
    N Okia
    Aug 1, 2006
Loading...

Share This Page