我正在做一個C#應用程序,它在登錄時將啓用Windows 7終端上的單一登錄(SSO)。我嘗試了在本網站上發現的一些常規制作GPO的東西,但是我無法安裝生成GPO代碼所需的gpmgmt 1.0類型庫,並說它與我的Windows不兼容。使用C#啓用單一登錄
任何人都有我如何使用任何方法使這項工作的建議。 我已經做了很多的研究,並在此網站沒有工作前面的主題...
這是我試過的代碼......但無法獲得正確的庫,使其工作,我甚至不相信這是好的...
GPMGMTLib.GPM gpm = new GPMGMTLib.GPM();
GPMGMTLib.GPMConstants gpc = gpm.GetConstants();
GPMGMTLib.GPMDomain gpd = gpm.GetDomain(Environment.GetEnvironmentVariable("USERDNSDOMAIN"), "", gpc.UseAnyDC);
GPMGMTLib.GPMSearchCriteria gps = gpm.CreateSearchCriteria();
GPMGMTLib.IGPMGPOCollection gpoc = gpd.SearchGPOs(gps);
string outputString = "";
foreach (GPMGMTLib.GPMGPO name in gpoc)
{
outputString += "ID: " + name.ID + "\tName: " + name.DisplayName + "\r\n";
}
MessageBox.Show(outputString);
gpoadmin.dll說,這是不兼容的
爲什麼你不能使用Windows身份驗證? http://stackoverflow.com/questions/5321671/dotnet-how-to-achieve-windows-authentication-in-window-form-application – 2013-04-30 14:29:33
因爲客戶端使用單點登錄...並將此功能添加到應用程序我覺得我會很好。 – 2013-04-30 14:38:00