2013-04-15 177 views
0

有沒有一種編程方式從secpol.msc編輯設置?以編程方式編輯secpol.msc?

我正在尋找類似於此:

 ManagementScope scope = new ManagementScope("root\\rsop\\user\\" + user.User.Value.Replace('-', '_')); 
     ObjectQuery query = new ObjectQuery("Select * from RSOP_PolicySetting"); 
     ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query); 

是root \ secpol \ ...的選項?

+0

我找到了解決方案。從secedit.exe導出讀取是完美的:https://gist.github.com/jkingry/421802 – hupseb

回答