directoryservices

Retrieve AD Custom Attribute in One Batch

随声附和 提交于 2019-12-24 03:05:21
问题 Is it possible to use the System.DirectoryServices.AccountManagement library and the PrincipalSearcher class to retrieve a custom attribute for all Principals returned from the call to FindAll() ? I'm currently using this example: http://msdn.microsoft.com/en-us/library/bb552835%28v=vs.90%29.aspx. However, when accessing my custom property/attribute, it seems to be making an additional trip to the AD store. I would like it to eagerly load this property at the initial call to FindAll() . 回答1:

Getting Error Querying Active Directory On The Server Only

三世轮回 提交于 2019-12-24 02:59:15
问题 I have the following block of code that queries Active Directory for users by Group Name using System.DirectoryServices.AccountManagement : var domainContext = new PrincipalContext(ContextType.Domain, "company.container.internal"); var groupPrincipal = GroupPrincipal.FindByIdentity(domainContext, IdentityType.Name, "Lvl1Users"); if (groupPrincipal != null) { //Read the values } Now the site uses the following: IIS7 on Win2k8 Windows Authentication Impersonation = True App Pool on .NET 4.0

PrincipalSearchResult<T> with PrincipalSearcher FindAll, why does T have to be Principal and not UserPrincipal

孤街醉人 提交于 2019-12-23 12:47:04
问题 I'm just curious: List<string> ADUsers = new List<string>(); using (PrincipalContext principle_context = new PrincipalContext(ContextType.Domain, "MYDOMAIN")) using (UserPrincipal user_principal = new UserPrincipal(principle_context) { Enabled = true, Name = "*", EmailAddress = "*" }) using (PrincipalSearcher user_searcher = new PrincipalSearcher(user_principal)) using (PrincipalSearchResult<Principal> results = user_searcher.FindAll()) { foreach (Principal p in results) { ADUsers.Add(p.Name

Forms Authentication against Active Directory - LDAP Protocol

南笙酒味 提交于 2019-12-23 05:32:52
问题 I need to create a web page that authenticates users against an existing active directory. The domain is actually a cloud computing configuration where there is a domain controller and multiple other servers on the stack. I understand that objects from the System.DirectoryServices namespace can be used. However, I cant seem to path the code to the active directory through the LDAP://domain.com address. There doesnt seem to be any communication going on. I suspect there is some initial

What permissions do I have to delegate in order to set UserCannotChangePassword in Active Directory through a C# UserPrincipal

Deadly 提交于 2019-12-22 05:34:29
问题 This seemed to have been asked a few years ago at Constraint violation when trying to set "User Cannot Change Password" in active directory from c# but no response actually answered the question sufficiently. I tried reviving the thread because I wanted to hear specifically from the originator as to wether he had solved the issue, but my response was deleted as it is, admittedly, an old question. I hope Resorath sees this as he may have more insight into the problem! Basically, the problem

Can't get deleted items from OpenLDAP Server using Content Synchronization Operation (syncrepl)

会有一股神秘感。 提交于 2019-12-22 04:01:52
问题 I set up my OpenLDAP server on a Ubuntu 19.04 VM and allowed replication (using this tutorial: https://help.ubuntu.com/lts/serverguide/openldap-server.html#openldap-server-replication). Everything for replication seems ok. I don't have set up a consumer server as my code will act as one, pulling modified elements regularly. The modified/added entries are correctly retrieved BUT I want to get deleted items and I can't seem to get it to work. As described by the RFC https://tools.ietf.org/html

How to set a binary attribute when using a AccountManagement Extension Class?

主宰稳场 提交于 2019-12-21 20:56:44
问题 I am using a custom class to expose some custom schema in Active Directory. I am storing a binary blob, per the project requirements this data must be stored in the AD, I can not use a external store (I would if I could). When I create the user it stores the blob fine. I also can retrieve the blob back out fine too and get all my data. The issue is if I need to update the value and I am getting errors Small example program: using System; using System.DirectoryServices.AccountManagement;

Mac OS X: Get current username and home directory for current user from Directory Services

折月煮酒 提交于 2019-12-21 19:53:47
问题 My app is written in Objective-C. How can I get the user name and home directory of the currently logged in user through directory services? Detail: My Cocoa app gets the current username and home directory with getenv("USER"), getenv("HOME"). Apparently this doesn't work right if the user is logged in through directory services. I am doing a chdir($HOME) and then running this command: login -fp $USER and it rejects it because, I think, login goes through the directory service to authenticate

0x80005000 Unknown Error on UserPrincipal.GetGroups with Special Characters in OU

£可爱£侵袭症+ 提交于 2019-12-21 18:45:23
问题 I'm trying to use the GetGroups method of UserPrincipal. If the User account is in an OU that contains a forward slash, the call to GetGroups fails with the COM Unknown Error 0x80005000. The user account is found just find and I can access other properties. If I remove the slash in the OU name then everything works. I found a reference to escaping the slash in the name but that's wrapped under the GetGroups method. I also found making sure to use the PrincipalContext(ContextType, String)

UserPrincipal.FindByIdentity throws exception - There is no such object on the server

扶醉桌前 提交于 2019-12-21 05:05:41
问题 I'm struggling with a simple scenario: I would like to retrieve my account from Active Directory using the username and password which I use to log into my computer. My first issue was that I was receiving a referral from the server when attempting to call UserPrincipal.FindByIdentity. I thought that this was a bit weird, given the fact that PrincipalContext.ValidateCredentials was working fine, but it turns out that my DC path was incorrect. I wasn't sure how to properly craft my OU/DC