[英]How to set TerminalServiceProfile Path in Windows server 2003 Active Directory using C#?
I know in Windows 2008 AD, we have msTsProfilePath AD attribute using which we can directly set the terminal service profile path. 我知道在Windows 2008 AD中,我们具有msTsProfilePath AD属性,我们可以使用该属性直接设置终端服务配置文件路径。
But we have windows 2003 AD and i need to set terminal service profile path using C#. 但是我们有Windows 2003 AD,我需要使用C#设置终端服务配置文件路径。 I came across following article and have come to know from some other articles that terminal service profile path gets stored in userParameters property.
我遇到了以下文章,并从其他一些文章中了解到终端服务配置文件路径存储在userParameters属性中。
http://www.selfadsi.org/user-attributes-w2k3.htm#List http://www.selfadsi.org/user-attributes-w2k3.htm#List
Can somebody tell me how to set CtxWFProfilePath in userParameters through C# ? 有人可以告诉我如何通过C#在userParameters中设置CtxWFProfilePath吗?
Thanks, 谢谢,
Nikhil. 尼基尔
Update: 更新:
Please refer to this MSDN forum where this gentleman "Konrad Neitzel" directed me to some useful links. 请访问此MSDN论坛 ,该先生“ Konrad Neitzel”将我引向一些有用的链接。 But as mentioned in the thread, i am finding difficulties in using WTSSetUserConfig method.
但是正如线程中提到的那样,我在使用WTSSetUserConfig方法时发现了困难。 Any idea ?
任何的想法 ?
I battled with this one too but finally was able to put together a working solution from dozens of different sites. 我也曾与之抗争,但最终能够将来自数十个不同站点的有效解决方案整合在一起。 I'm not sure is this exactly what you are needing but hopefully it helps
我不确定这是否正是您所需要的,但希望能有所帮助
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();
You can find all the attributes from this site (another tough thign to find out) http://www.virtualizationadmin.com/articles-tutorials/terminal-services/scripting/scripting-server-based-computing-terminal-services-attributes-active-directory-user-objects.html 您可以从该站点找到所有属性(另一个很难找到的属性) http://www.virtualizationadmin.com/articles-tutorials/terminal-services/scripting/scripting-server-based-computing-terminal-services-attributes -active-directory-user-objects.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.