如何从userParameters属性获取Active Directory中的终端服务属性值 [英] How to get terminal services property values in Active Directory from userParameters attribute
问题描述
我正在使用dirsync来获取在Active Directory(changelog)中已更改的属性值。
以下链接说明了如何使用目录同步获取属性值:
I am using dirsync to get the attributes value that have changed in Active Directory(changelog). The following link explains how the dirsync is used to get attribute values :
' http://blogs.technet.com/b/isrpfeplat/archive/2010/09/20/using -the-dirsync-control.aspx '
我正在更改用户的远程桌面服务配置文件下的本地路径属性。我已经运行了一个使用dirsync来获取AD中更改的对象的客户端。
在客户端中,更改的属性为 userParameters
,并且值采用加密形式。
I am changing the attribute Local path under Remote Desktop Services Profile of a user. I have ran a client which uses dirsync to get the changed objects in AD.
In the client the attribute that is changed is userParameters
and the value is in encrypted form.
CtxCfgPresent P☺CtxCfgPresent???? ☻☺CtxWFProfi
lePath?↑→☺CtxWFHomeDir?????????????"☻☺CtxWFHomeDirDrive?☺CtxShadow????☺CtxMaxDis
connectionTime????☺CtxMaxConnectionTime????☺CtxMaxIdleTime???? ☻☺CtxWorkDirector
y?☺CtxCfgFlags1????"☻☺CtxInitialProgram?
有没有一种方法可以从userParameters中获取实际值。
Is there a way to get the actual value form the userParameters.
推荐答案
方法1:解析自己:)
信息结构在[MS-TSTS]规范中进行了描述:
Structure of the info is described in the [MS-TSTS] spec:
http://msdn.microsoft.com/en-us/library/ff635189.aspx
方法2 :IADsTSUserEx界面
例如,在C#中:
DirectoryEntry userEntry = new DirectoryEntry("LDAP://domain.com/CN=user1,CN=Users,DC=domain,DC=com", "user", "pwd")
IADsTSUserEx tsUser = userEntry.NativeObject as IADsTSUserEx;
IADsTSUserEx的定义如下:
(我只需要读取我项目中的信息,所以只有吸气剂,而没有setter)
Definition of IADsTSUserEx is something like this:
(I only need to read the info in my project, so only have the getter but no setter)
[
ComImport,
InterfaceType(ComInterfaceType.InterfaceIsIDispatch),
Guid("C4930E79-2989-4462-8A60-2FCF2F2955EF")
]
private interface IADsTSUserEx
{
string TerminalServicesProfilePath { get;}
string TerminalServicesHomeDirectory { get;}
string TerminalServicesHomeDrive { get;}
bool AllowLogon { get;}
long EnableRemoteControl { get;}
long MaxDisconnectionTime { get;}
long MaxConnectionTime { get;}
long MaxIdleTime { get;}
int ReconnectionAction { get;}
int BrokenConnectionAction { get;}
bool ConnectClientDrivesAtLogon { get;}
bool ConnectClientPrintersAtLogon { get;}
bool DefaultToMainPrinter { get;}
string TerminalServicesWorkDirectory { get;}
string TerminalServicesInitialProgram { get;}
}
您可能还使用其他脚本语言,比C#更简单。
You may also use other scripting language, which will be simpler than C#.
vbscript:
http://www.wisesoft.co.uk/scripts/vbscript_read- write_terminal_services_settings.aspx
PowerShell:
这篇关于如何从userParameters属性获取Active Directory中的终端服务属性值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!