我正在寻找一种方法来查询用户对象的终端服务主文件夹属性在Active Directory中。我的目标是能够执行反向查找,找到用户(S)使用特定的主文件夹。
I'm looking for a way to query the Terminal Services Home Folder property of user objects in Active Directory. My goal is to be able to perform a reverse lookup, finding the user(s) that use a particular home folder.
通常情况下执行搜索,我会做这样的事情:
Normally to perform a search I would do something like this:
using (var search = new DirectorySearcher()) { // Find a user based on their telephone number search.Filter = "(telephoneNumber=999)"; search.PropertiesToLoad.Add("displayName"); var result = search.FindOne(); if(result != null) {....} }
但终端服务设置似乎并不有一个可供参考的LDAP属性的名称 - 在过去的设置的这些价值,我不得不使用IADsTSUserEx接口与现有的DirectoryEntry操纵TS配置文件和主文件夹属性。然而,当我的用户帐户有问题,这是唯一有用的 - 这是不是很实用步骤,通过每个用户的域,并创建一个DirectoryEntry对象对他们来说只是为了检查他们的TS配置文件路径
But the Terminal Services settings don't seem to have a referable LDAP attribute name - in the past to set these values I've had to use the IADsTSUserEx interface with an existing DirectoryEntry to manipulate the TS profile and home folder properties. However this is only useful when I have the user account in question - it's not very practical to step through every user in a domain and create a DirectoryEntry object for them just to check their TS profile path.
有没有执行在.NET中的WHERE User.TerminalServicesProfilePath = X查询任何实际的方法?
Is there any practical way to perform a "WHERE User.TerminalServicesProfilePath=X" query in .NET?
推荐答案没人在这里,所以,我试着解释。
Nobody here so, I try an explanation.
在Windows Server 2008中(和R2),终端服务终端服务器运行时接口取自称为用户活动目录属性的用户参数 userParameters 。 作为微软文档用户参数包含的终端服务器参数作为BLOB 。
In Windows Server 2008 (and R2), the Terminal Services Terminal Server Runtime Interface takes the user parameters from the user Active-Directory attribute called userParameters. As explain in Microsoft documentation userParameter contains Terminal Server parameter as blob.
更多推荐
终端服务主文件夹withDirectory服务反向查找
发布评论