通过System.DirectoryServices中管理终端用户 [英] Managing terminal users through System.DirectoryServices

查看:214
本文介绍了通过System.DirectoryServices中管理终端用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我需要的参数经常更改为启动程序的环境中时,到终端服务器的用户日志。截至目前,我们打开计算机管理管理单元和编辑环境选项卡的用户,并用手在启动以下程序在登录:更改参数。我想这个过程自动化。

I have a environment where I need to frequently change the parameters to a program that is launched when a user logs in to the terminal server. As of right now we open the computer management snap-in and edit the environment tab for the user and change the parameters by hand under "Start the following program at logon:". I would like to automate the process.

我一直在寻找到System.DirectoryServices中和System.DirectoryServices.AccountManagement和阅读所有我可以了解它。到目前为止,我最好的猜测是,我需要编辑的信息存储在参数属性(最差的名称可能为属性,废墟google搜索)。其原因的猜测是,当我列出所有我得到的属性

I have been looking in to System.DirectoryServices and System.DirectoryServices.AccountManagement and reading all I can about it. So far my best guess is that the information I need to edit is stored in the "Parameters" Properties (worst name possible for a property, ruins googling). The reason for that guess is when I list all of the Properties I get

(...)
Name: HomeDirDrive
Value:
Name: Parameters
Value:                                                 P☺CtxCfgPresent????☺CtxCf
gFlags1????☺CtxShadow????*☻☺CtxMinEncryptionLevel? @☺CtxWorkDirectory???????????
?????????????????????"C☺CtxInitialProgram???????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????
???????????????
Name: PrimaryGroupID
Value: 513
(...)

CtxInitialProgram和CtxWorkDirectory似乎有关我与我的工作。

CtxInitialProgram and CtxWorkDirectory seem relevant to what I am working with.

现在我坚持,因为我无法弄清楚如何,或者发现和资源来帮助我,读,写正确的值。

Now I am stuck as I can not figure out how to, or find and resources to help me out, reading and writing the values correctly.

任何帮助将是很大的AP preciated。

Any help would be greatly appreciated.

编辑 -  我发现这个答案在其他地方在互联网上 在互联网上其他地方问我找到了答案:

EDIT -- I found this answer elsewhere on the internet Asking elsewhere on the internet I found the answer:

不幸的是这一数据连接codeD专有格式。唯一支持的以编程方式管理它是通过使用IADsTSUserEx ADSI接口,自带的终端服务。你基本上NativeObject属性只投该COM接口(创建所需的COM引用后),然后访问该接口公开的属性。

Unfortunately this data is encoded in a proprietary format. The only supported way to manage it programmatically is by using the IADsTSUserEx ADSI interface that comes with terminal services. You basically just cast the NativeObject property to this COM interface (after creating the required COM reference) and then access the properties exposed by the interface.

现在我的问题是我如何设置一个COM引用,我从来没有做过这样的事情了。

Now my question is how do I set up that COM reference, I have never done anything like that before.

推荐答案

在互联网上其他地方问我找到了答案:

Asking elsewhere on the internet I found the answer:

不幸的是这一数据连接codeD专有格式。唯一支持的以编程方式管理它是通过使用IADsTSUserEx ADSI接口,自带的终端服务。你基本上NativeObject属性只投该COM接口(创建所需的COM引用后),然后访问该接口公开的属性。

Unfortunately this data is encoded in a proprietary format. The only supported way to manage it programmatically is by using the IADsTSUserEx ADSI interface that comes with terminal services. You basically just cast the NativeObject property to this COM interface (after creating the required COM reference) and then access the properties exposed by the interface.

这篇关于通过System.DirectoryServices中管理终端用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆