I need to set properties related to Remote Desktop Services on Active Directory users in .NET (i.e., via System.DirectoryServices), but I can't see that these properties are exposed by the API? I know there is a COM interface for this purpose, IADsTSUserEx. Please show me how I can get at these properties in .NET :) Bear in mind that the programming language is Python.
A:
The .NET DirectoryServices API doesn't expose AD properties directly: instead, there's a big Properties
collection on the DirectoryEntry
class. If you can find out the names of the attributes in the underlying AD schema then you be able to find them in this collection.
This list should have the properties you're interested in: http://msdn.microsoft.com/en-us/library/ms675090.aspx
For instance, the msTSMaxIdleTime
attribute: http://msdn.microsoft.com/en-us/library/ms678175.aspx
Tim Robinson
2010-03-07 10:52:13
I can't see that this works. From the Active Directory Users and Computers console I set a certain user's Remote Desktop Services User Profile Path (via Properties->Remote Desktop Services Profile), to a certain path. I assume the corresponding DirectoryEntry property would be "msTSProfilePath"? When I obtain a DirectoryEntry corresponding to that user, however, no value is set for the msTSProfilePath property.I've posted the relevant Python code at http://pastebin.com/gJJM3PEH. The resulting output is an empty list.
aknuds1
2010-03-08 20:37:17
I don't have permission to set this up right now (I'm at work), but let me see if I can check later.Can you modify the Python code to dump out the names of all properties?
Tim Robinson
2010-03-09 11:03:05