Answer: (update - thanks to Gary Lapointe who pointed out that my last post used internal objects, I actually tested my code and did more research and found that there is no way in the API to get to the default. If someone knows of a way I'm happy to learn. for now, here is a workaround that I have found - using the STSADM command line)
Process stsadmProcess; stsadmProcess = new Process(); stsadmProcess.StartInfo.WorkingDirectory = @"C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN"; stsadmProcess.StartInfo.FileName = "stsadm.exe"; stsadmProcess.StartInfo.Arguments = "-o enumssp -default"; stsadmProcess.StartInfo.UseShellExecute = false; stsadmProcess.StartInfo.RedirectStandardOutput = true; stsadmOutput = new StringBuilder(""); stsadmProcess.Start(); stsadmProcess.WaitForExit(); XmlDocument xdoc = new XmlDocument(); xdoc.LoadXml(stsadmProcess.StandardOutput.ReadToEnd()); MessageBox.Show(xdoc.SelectSingleNode("//Ssp[@Default='true']").OuterXml);
1 comment:
These classes are both internal so you'd need reflection to get to them - am I missing something?
Post a Comment