问题描述
我从 AD 中阅读了以下属性,
I have read the following properties from AD,
TerminalServicesProfilePath
TerminalServicesHomeDirectory
TerminalServicesHomeDrive
我已经尝试过 DirectoryEntry 和 DirectorySearcher.但它们不包括属性.
I've tried DirectoryEntry and DirectorySearcher. But they does not include the properties.
我在 vbscript 和 VC 中找到了一些示例来阅读它们.但是我未能使其在 C# 中工作.我错过了一些棘手的事情吗?
I found some example in vbscript and VC to read them. However I failed to make it working in C#. Am I missing some tricky thing?
我必须在Windows Server"上运行它才能使其工作吗?win XP 可以读取吗?
Am I have to run it on "Windows Server" to make it works? Can it be read from win XP?
推荐答案
具体记不太清了,大概是这样的:
I don't remember exactly, but it's something like this:
//user is a DirectoryEntry
IADsTSUserEx adsiUser = (IADsTSUserEx)user.NativeObject;
然后您可以通过 adsiUser 获取所需的 TerminalServices 属性.
then you can get the TerminalServices properties you want via adsiUser.
根据我的经验,由于您使用的库,您最好在可以访问 AD 的 Windows Server 上进行开发.那么你可能也会完成上述工作:)
From my experience you're better off developing on a Windows Server with access to AD due to the libraries you use. Then you'll probably make the above work, too :)
这篇关于如何在 C# 中从 LDAP 读取 TermainsServices IADsTSUserEx 属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!