2012-04-20 66 views
0

我知道在Windows 2008 AD中,我們有msTsProfilePath的AD屬性,使用它我們可以直接設置終端服務配置文件的路徑。如何在Windows Server 2003 Active Directory中使用C#設置TerminalServiceProfile路徑?

但我們有Windows 2003 AD,我需要使用C#設置終端服務配置文件路徑。 我遇到以下文章,並從其他一些文章中瞭解到終端服務配置文件路徑存儲在userParameters屬性中。

http://www.selfadsi.org/user-attributes-w2k3.htm#List

有人能告訴我如何設置CtxWFProfilePath通過C#userParameters?


謝謝,
Nikhil。

更新:
請參閱本MSDN forum這個地方紳士「康拉德·Neitzel」指示我一些有用的鏈接。但正如在線程中提到的,我在使用WTSSetUserConfig方法時遇到困難。任何想法 ?

回答

0

請參閱此鏈接MSDN Foru米的答案我接受有

0

我爭奪這一個太多,但終於能放在一起從幾十個不同地點的工作方案。我不知道這是你需要什麼,但希望它有助於

PrincipalContext domainContext = new PrincipalContext(ContextType.Domain, "name", "container"); 
UserPrincipals user = UserPrincipals.FindByIdentity(domainContext, "ad_user_name"); 

DirectoryEntry dirEntry = (user.GetUnderlyingObject() as DirectoryEntry); 
dirEntry.InvokeSet("TerminalServicesProfilePath", "yourpath"); 

dirEntry.CommitChanges(); 

你可以找到所有從該站點的屬性(另一項艱鉅的thign找出) http://www.virtualizationadmin.com/articles-tutorials/terminal-services/scripting/scripting-server-based-computing-terminal-services-attributes-active-directory-user-objects.html

+0

這個屬性不存在不幸的是,這不起作用。沒有「TerminalServicesProfilePath」屬性,甚至msTsProfilePath不存在。 – 2017-08-25 16:59:32

相關問題