Help: OWSADM hangs when executing from C# web service
- From: "Abhi" <kulkarna@xxxxxxxxx>
- Date: 23 May 2005 06:40:52 -0700
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.
Process process = new Process();
process.StartInfo.FileName = @"C:\Program Files\Common
Files....\WSADM.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 does complain 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 or RAM!)
Any help will be greatly appreciated.
Thanks!
.
- Prev by Date: Re: Hide property at designtime
- Next by Date: RE: text color
- Previous by thread: dataGrid - Unselecting a cell
- Next by thread: save file to bin directory
- Index(es):
Relevant Pages
|