It seems to me that one should always properly dispose resources when calling Directory Services API with no exception (yet many samples, blogs and tutorials often ignore, or do one way with this call, and the other way with another call). Since all of the following DS classes implement the Dispose method, so I just want to confirm once...
Hi,
I am doing an C# application targeting WinXP, Vista, and 7 Operating Systems.
One feature is, I can Add, Remove, Modify the Group set to a user programmatically.
Can I ask for help how to make this happen?
Will it be possible to do this in WMI? My codes mainly using WMI to get the users..
...
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...
I have a program that will let me manage users on our terminal server that we use to demo our software. I have been trying to improve the performace of adding users to the system (It adds the main account then it adds sub accounts if needed, for example if I had a user of Demo1 and 3 sub users it would create Demo1, Demo1a, Demo1b, and D...
Hi
We are experiencing a performance problem when communicating with the active directory using System.DirectoryServices. DirectoryEntry.Invoke("SetPassword", new object[] { password }) sometimes takes 15 seconds. The Service that makes the call is running on the same machine.
What could make it that slow?
Cheers,
bja
...
Here's what I'm trying to do:
I want to get a list of all users and groups that belong to a specific department (entered by the user) from Active Directory using VB.Net and DirectoryServices.
Any suggestions?
...
I have a list of user's security identifiers and I need to get a list of userPrincipalName's... is there any way that I can get it without loading up the users DirectoryEntry and pulling in the userPrincipalName property?
I need the most efficient method possible because this is done a lot
...
I need a portion of code in C# (on top of .Net 2.0) tha given the Novell workstation name finds me the workstation id (the guid). I tried using the DirectorySearcher class with an LDAP query (CN=workstation_name) and it didn't work. I cannot find any Novell documentation for this too. Your help is appreciated.
...
I'm currently trying to authenticate via Active Directory Services using the PrincipalContext class. I would like to have my application authenticate to the Domain using Sealed and SSL contexts. In order to do this, I have to use the following constructor of PrincipalContext (link to MSDN page):
public PrincipalContext(
ContextType ...
For a user in active directory, the properties hold values for lastlogontime & lastlogontimestamp but the logoncount is 0. I am having only one domain controller in that domain.
I found from surfing, that logonCount value of 0 indicates that the value is unknown. But I am totally confused with why it is unknown. Is that an issue with A...
Hey everyone,
On a Vista dev machine I used this code successfully to change user "Administrator" password:
directoryEntry.Invoke("SetPassword", "new");
When I moved it over to my Server 2008 dev machine that code did not work, and I was forced to use the following code:
directoryEntry.Invoke("ChangePassword", new object[] { "old", ...
I want to extend the GroupPrincipal class to handle some custom properties:
using System.DirectoryServices.AccountManagement;
[DirectoryRdnPrefix("CN")]
[DirectoryObjectClass("group")]
public class MyGroupPrincipal : GroupPrincipal {
// ...
}
How could I override the Members property for MyGroupPrincipal so that if it has a membe...
Hello,
I'm getting the following error
IIS://networth-web6/W3SVC/AppPools/netbasistest
errorSystem.Runtime.InteropServices.COMException
(0x80020006): Unknown name. (Exception
from HRESULT: 0x80020006
(DISP_E_UNKNOWNNAME))
at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args)
at ASP.nb_test_...
Is it possible to search for multiple user names with a single PrincipalSearcher call. Maybe by providing an 'OR' of the requested user names as the filter criteris ?
...
I'm using System.DirectoryServices to list the status of websites running on a server. Currently I'm using impersonation of an admin account for this to run but I'd prefer to have a specific user account with the bare minimum privileges.
Can anyone point me in the right direction?
...
Hi, I am looking to be able to pull a list of current OU's from Active Directory I have been looking at some example code online for sometime, but O don't seem to be able to get this to work.
string defaultNamingContext;
DirectoryEntry rootDSE = new DirectoryEntry("LDAP://RootDSE");
defaultNamingContext = rootDS...
I have this code currently,
string defaultNamingContext;
DirectoryEntry rootDSE = new DirectoryEntry("LDAP://RootDSE");
defaultNamingContext = rootDSE.Properties["defaultNamingContext"].Value.ToString();
rootDSE = new DirectoryEntry("LDAP://" + defaultNamingContext);
//DirectoryEntry domain = new...
Sorry for being an uber pain people, its all very new :(
Already had alot of help on this, but don't seem to be able to see the problem, I am trying to populate a combo box with a list of all the current OU's, later to send each machine within that OU a shutdown command. (Acquiring AD OU list & Active Directory list OU's) were my previo...
--Update--
I've continued to look into this issue but have had little luck. The only work around I've found was to create a function which uses reflection to grab the private field that stores the password from the underlying DirectoryEntry object in the PrincipalContext, which I then use to create a new PrincipalContext with the same ...
Hey
I have the following code. I get a directory entry for a user (strpath).
And then I get the groups where the user is listed.
How can I get the number of users in each group?
DirectoryEntry myDE = new System.DirectoryServices.DirectoryEntry(strpath);
object obGroups = myDE.Invoke("Groups");
foreach (object ob in (IEnumerable)obGrou...