Search for single member in an Active Directory Group

Hello all,
I'm attempting to find a better method to search if a user is a member of a group in Active Directory. I currently retrieve the entire member attribute of the group.
I need to reduce the time of the query. I would like to be able to search for a specific member (user) of the group instead of retrieving the entire member list of the group.
I can post my current code if that would help.
I believe the default Active Directory group object is the ldap group. I know that there are posixGroup and groupOfUniqueNames ldap classes available, but I'm not sure if Active Directory has access to those classes.
Is my request possible using the group ldap object?

Thanks for the reply.
I have read the first post you gave, but not the second. I'm off to read that now.
My main concern is that I don't have access to the DN of the user in the member attrib. I have access to their CN and uid (which is indexed). From what I can recall from when I last updated this code, I couldn't create a wildcard search filter e.g.,:
(&(cn=All Scientists)(objectClass=Group)(member=CN=Albert Einstein*))
If that's correct and I require a DN, is there any way around this?
I was interested in the posixGroup and groupOfUniqueNames classes. I wasn't aware that these were available through Active Directory, but I see them listed in the AD schema (http://msdn.microsoft.com/en-us/library/ms683908(VS.85).aspx).
If I'm correct, posixGroup would allow for a filter of (&(cn=All Scientists)(objectClass=posixGroup)(memberUid=AEinstein))
I'm not sure how typical it is to use the posixGroup class in AD and I'll have to check with my AD team before moving forward with this. But I wanted to get some more direction/ideas before asking them to create some posixGroup objects for me.
I'm now going to go and read the second post you linked, but I wanted to put the rest of my details out there.
Thanks again.

Similar Messages

  • Search for specific user in an Active Directory group

    Hello,
    I have an OU containing a number of Groups. Each group contains a number of members.
    I'm currently retrieving the entire list of members from each group by searching for the members attrib for each group. This is not an ideal approach as the query execute time is a bit too long.
    from what I can tell, the group class is group (opposed to a groupofuniquenames). Is there a way to query for the specific member?
    Thanks

    Thanks for the reply.
    I have read the first post you gave, but not the second. I'm off to read that now.
    My main concern is that I don't have access to the DN of the user in the member attrib. I have access to their CN and uid (which is indexed). From what I can recall from when I last updated this code, I couldn't create a wildcard search filter e.g.,:
    (&(cn=All Scientists)(objectClass=Group)(member=CN=Albert Einstein*))
    If that's correct and I require a DN, is there any way around this?
    I was interested in the posixGroup and groupOfUniqueNames classes. I wasn't aware that these were available through Active Directory, but I see them listed in the AD schema (http://msdn.microsoft.com/en-us/library/ms683908(VS.85).aspx).
    If I'm correct, posixGroup would allow for a filter of (&(cn=All Scientists)(objectClass=posixGroup)(memberUid=AEinstein))
    I'm not sure how typical it is to use the posixGroup class in AD and I'll have to check with my AD team before moving forward with this. But I wanted to get some more direction/ideas before asking them to create some posixGroup objects for me.
    I'm now going to go and read the second post you linked, but I wanted to put the rest of my details out there.
    Thanks again.

  • Not Member found in Active Directory Group using LDAPRealmV2

    Hi Folk:
    I have configured a LDAPRealmV2 and it loaded ok, but I don't see any users in
    the group at the console.
    Here is the CustomRealm membership filter line in ConfigurationData section:
    membership.filter=(&(member=%M)(objectclass=group))
    Anyone has any ideas why.
    It seems to found the entry but it returns zero member in the attribute.
    Here is a sample of the log file.
    -- groupDN CN=Administrators,CN=Builtin,DC=lsi,DC=locussystems,DC=com
    -- scope base DN & below
    -- filter (&(member=*)(objectclass=group))>
    ####<May 13, 2003 1:43:07 PM EDT> <Debug> <LDAPRealm> <WLIN1> <sampleportalServer>
    <ExecuteThread: '8' for queue: 'default'> <kernel identity> <> <000000> <-- attrs[0]
    member>
    ####<May 13, 2003 1:43:07 PM EDT> <Debug> <LDAPRealm> <WLIN1> <sampleportalServer>
    <ExecuteThread: '8' for queue: 'default'> <kernel identity> <> <000000> <--- search
    returned 1 element sets>
    ####<May 13, 2003 1:43:07 PM EDT> <Debug> <LDAPRealm> <WLIN1> <sampleportalServer>
    <ExecuteThread: '8' for queue: 'default'> <kernel identity> <> <000000> <----
    LDAPEntry CN=Administrators,CN=Builtin,DC=lsi,DC=locussystems,DC=com>
    ####<May 13, 2003 1:43:07 PM EDT> <Debug> <LDAPRealm> <WLIN1> <sampleportalServer>
    <ExecuteThread: '8' for queue: 'default'> <kernel identity> <> <000000> <----
    attributes in this set:1>
    ####<May 13, 2003 1:43:07 PM EDT> <Debug> <LDAPRealm> <WLIN1> <sampleportalServer>
    <ExecuteThread: '8' for queue: 'default'> <kernel identity> <> <000000> <----
    no interesting results found for that LDAPEntry: member>
    Any help is greatly appreciated.
    Herman

    To your question:
    "How can I create a new event log every time without saving to the original event log textfile?"
    The answer provided by Mike Laughlin doesn't require you save anything to a text file - so either I'm misunderstanding this follow-up, or you are misunderstanding Mike's post. :)
    To answer your other follow up... try:
    $goodCount = 0
    $badCount = 0
    Import-Csv $importFile | ForEach {
    $SamAccountName = $_.SamAccountName
    try {
    $user = Get-ADUser -Identity $SamAccountName -ErrorAction Stop
    $goodCount++
    } catch {
    Write-EventLog # <-finish this command however you want
    $badCount++
    write-host "Users imported: $goodCount"
    write-host "Users not imported: $badCount"
    G. Samuel Hays, MCT, MCSE 2012, MCITP: Enterprise Admin
    Blog:gsamuelhays.blogspot.com
    twitter:twitter.com/gsamuelhays

  • SharePoint 2013 Workflow (SPD 2013) fails for Active Directory Group members

    Hi
    I have a SharePoint 2013 site called "Team Meetings". There are a number of lists and an InfoPath form library.
    The site's SharePoint Group "Team Meeting Members" has two Active Directory groups (All Club Managers and All Club Police) as members. Those two AD groups contain all the people that I want to have  access to the library and list, except for
    a few additional folk who I have made individual members. 
    My PROBLEM:
    I  have created a SharePoint 2013 Workflow using SPD 2013 associated with the  Form Library. Workflow is set to start on new or modified item. The first action is to write to history list, then determine the status (Submitted or Pending) of
    the form and go to different Stages depending on that status.
    The workflow works perfectly for any user who has been added directly to the SharePoint group (Team Meetings Members) BUT FAILS at the very first action for anyone who is a member of one of the AD groups. I know the Workflow is fine because I've tested it
    with numerous people who are direct members of the SharePoint Group, but whenever a person who is a member of the AD group tries it the Workflow just fails.
    Here's a print of the info from the Workflow Status page (I don't have access to server logs):
    RequestorId: 4494760f-92ff-2e8c-90d2-cc7df0e6baa4. Details: System.ApplicationException: HTTP 401 {"Transfer-Encoding":["chunked"],"X-SharePointHealthScore":["0"],"SPRequestGuid":["4494760f-92ff-2e8c-90d2-cc7df0e6baa4"],"request-id":["4494760f-92ff-2e8c-90d2-cc7df0e6baa4"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"MicrosoftSharePointTeamServices":["15.0.0.4420"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1;
    RequireReadOnly"],"Cache-Control":["max-age=0, private"],"Date":["Mon, 10 Mar 2014 01:31:42 GMT"],"Server":["Microsoft-IIS\/8.0"],"WWW-Authenticate":["NTLM"],"X-AspNet-Version":["4.0.30319"],"X-Powered-By":["ASP.NET"]}
    The HTTP response content could not be read. 'Error while copying content to a stream.'. at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance
    instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor 
    Members of the SharePoint Group "Team Meetings Members" have Contribute Access to both the form library and another list that the workflow writes to as well as the Workflow History list (which in SP 2013 uses the credentials of the
    user who started the workflow, unlike 2010 which used System Account).
    All members of the Team Meetings Members group, whether they are individual members or part of one of the AD groups, have no problems opening and saving forms etc. It's just the Workflow that doesn't like them...
    I am stumped. I've spent many hours searching for a reason for this. There are about 200 people in the two AD groups so I really don't want to have to add them all individually - especially when these groups are managed in AD for a whole bunch of other reasons
    and using the AD groups means I'll basically never have to worry about modifying the SharePoint access permissions.
    Does anyone have any ideas why this is happening and what I can try to fix it?
    Mark

    Hi Lars,
    I'm afraid not so far but we are trying a few things today so I will post back with results.
    First thing we are doing is making the AD Group universal because one of our (external provider) gurus remembers seeing something about that. He also sent me a link to a post where they were talking about earlier
    versions but having similar issues and their solution was to make sure the app pool account has sufficient permissions in AD::
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/27a547da-5cc0-49d7-8056-6eb40b4c3242/failed-to-start-workflow-access-is-denied-exception-from-hresult-0x80070005-eaccessdenied
    This part of that thread looks interesting but we haven't checked it yet as were trying the universal setting first:
    "If the users participating in the workflows have been added to the SharePoint site via Active Directory groups, SharePoint has to update the user’s security token periodically by connecting to
    the domain controller. By default, the token times out every 24 hours. But if the application pool account did not have the right permissions on the domain controller to update the user’s token, user will keep getting the access denied error. The error was
    intermittent because when the user browsed to any page other than the workflow form, the token was getting updated successfully.
    You can try to fix it through granting the application pool account the appropriate permission by adding the account to the group “Windows Authorization Access Group” in Active Directory."
    I'll update when we try these ideas. If you have any luck please do the same.
    Mark
    (sorry about formatting - using my phone....)
    Mark

  • Managing Office 365 Components for a large enterprise using Active Directory

    Opening Office 365 to a large enterprise (7000 users) implies some controls be placed around who can subscribe to what and which Add-Ons a user might have/need/desire access to.
    To place these controls around, for example, licensing Project Online to individual users, we are proposing creation of Active Directory groups for each add-on and use powershell or other method to read the AD FS user groups, then flip the bit on the O365
    user profile for that member to allow them to select the Add-On.
    At any point in time, our Asset Management team can use the AD group to determine licensing distribution and chargeback to internal cost centers.
    Does this seem like a viable approach?
    Any other approaches that have worked?

    John,
    After your users and home profile paths are created in AD - have your tried running the createhomedir command from Terminal? Assuming your AD plugin settings are correct on your server - specifically the 'Use UNC path...' - try running the command (in Terminal) below on your document (home folder) server:
    sudo createhomedir -s
    This command should query your server's search path (check the path using Directory Utility - located in /SystemLibrary/CoreServices) and find any users (preferably your AD network accounts - that's the -s option) that should have home folders on that server and create them. Note that this command nust be run as root - hence the sudo
    To test - try creating a new AD user and point their profile to your Mac sharepoint - then run the command. You could also run the command on your Mac server to create an account for just the new user - just add their name at the end of the command above:
    sudo createhomedir -s newusername
    Hopefully one of these suggestions will work for you...
    Ken

  • Syncing Active Directory Groups for Unity Distribution Groups

    We have multiple remote stores with managers that move around quite a bit. This poses an administration nightmare when trying to keep voicemail distribution lists up to date. Is there a way to syncronize an active directory group to a Unity voicemail distribution group? Therefore when we move a manager around in ADS the user automatically moves in Unity.

    Unfortunately this feature has not been re-implemented in Unity Connection. This is one of the few things from Unity that I miss. I suggest voicing your desire for this as a feature enhancement with your Cisco AM.
    If you are doing that many changes you may want to consider going through the Cisco Unity Connection Provisioning Interface. At least you could script the changes there using code that checked AD group membership and replicated the changes into CUC.

  • Use principal name for email if blank in Active Directory

    Hi all,
    allthough I set "Use principal name for email if blank in Active Directory", Spiceworks asks me for an emailadress when i want to Login to the Portal with an AD user without emailadress.
    This topic first appeared in the Spiceworks Community

    Hi,
    What if we change the user name of user account, will it have impact on roaming profiles.
    Yes, it will affect roaming profiles. Please rename the roaming profile folder as the new user account name, in addition, change the profile path in ADUC.
    Here is an related article below for you:
    How to Rename a Windows 7 User Account and Related Profile Folder
    http://social.technet.microsoft.com/wiki/contents/articles/19834.how-to-rename-a-windows-7-user-account-and-related-profile-folder.aspx
    Best Regards,
    Amy

  • Lion Server not reading Active Directory Groups reliably

    I am trying to upgrade one of our XServes from Snow Leopard Server to Lion Server and am running into a strange issue with our Active Directory based users and Groups.
    The current Snow Leopard Server serving files from a XSan volume is running fine, though we find a very long Lag time for Windows users to connect. Once a few users have connected the lag seems to go away, but it is still not nearly as fast as Mac users connecting or Windows connecting to a PC server.
    So I have connected a second Xserve to the SAN and performed a clean install of Lion Server. Initially while it would find my Active Directory Groups it would not import any of the users, so obvioulsly no one could connect. In a last ditch effort I installed the beta of 10.7.4, which seemed to resolve the issue for a small group of test users. However as I expanded the test I found that some users would get a message that the were no resources available to them, or they didn't have the correct permissions. This is very strange as everyone is in the same group so should have the same permissions. As a test I took one of the user accounts and created a new share and gave him R/W permission to that share and suddenly all of the shares that he should have had permission to in the first place popped up.
    The only thing that I can think of is that we have such a large Active Directory structure that the authentication is timing out or reaching some user limit and stops looking. (we have over 50,000 users and thousands of groups spread through multiple OUs in the AD structure)
    The new Server.app in Lion looks nice, but it does not seem to have nearly the robustness of the previous Server Admin tools. For instance, I never needed or wanted to setup a "Golden Triangle" but with Lion it is required. Perviously I could search for AD users or groups and drag them from the search window to the share to assign permission, now even though I've imported the groups and users it needs to search the entire directory when assigning permissions - why can't it see the groups that are already there? Why can I run a dscl search and find a user or group instantly, but the Server.app hangs for 5 minutes and shows 0 results?
    Has anyone found a way to make Lion Server work in an enterprise environment?

    Yesterday morning I bound a 10.7.4 server to our AD, and in the afternoon I eventually saw all the AD users, groups, etc show in Workgroup Manager. Now, with dscl, I can see all the AD user and group records, and with Workgroup Manager, I can search the groups, users, and computers, but with the Server.app, when trying to create new group of the type "Imported group from another directory", the searches returned nothing. Directory Utility can show all the AD information also. Our AD has thousands of user record, and so it is reasonable that it may take some time for the Mac server to get all the info. But from the add users or groups interface, I just could not get any search results. What could be wrong then? 

  • FCS 1.5 Not all Active Directory groups visible in list

    Hi,
    We just upgraded Final Cut Server to 1.5 and want to make use of Active Directory groups to set permissions in FCS. I've created a few groups in AD which do not appear in the list when I want to add these to Group Permissions. I do see many AD groups but some are not in the list. I can find the group in the Directory application and also with dscl (dscl /Active Directory/domain.tld -read /Groups/fcs-editor).
    Please advice.
    Thanks in advance,
    Martin

    I found a solution, though it might be still temporary. See if you can narrow down your Directory Search Policy. In your AD forest, you might need just one domain for your department, location, etc.
    So, in Directory Utility, click on Search Policy, delete "/Active Directory/All Domains", don't apply yet, but click on the plus sign, and see what specific domains you can choose from there. Do the same to contacts.
    Though still I can see now 1.592 records of groups or users when I run dscl but at least I know that AD administrators can really clean up our groups listings ( some of those groups are not being used) , and try to keep the number under 2,000.
    It has to be a way to increase the default number of 2,000 in Search Policy, but I haven't had time to do that

  • SharePoint 2013 Active Directory Groups represented as c:0+.w| SID in UserInformation list instead of c:0+.w|Domain\Groupname

    Hi
    We are running on SharePoint Server 2013.When we add AD groups as permissions, we see that the group name is being displayed properly in the permissions. Whereas when I click on the groupname I see the SID with the Sharepoint specific claims characters,
    instead of domain\groupname. I understand that the claims characters are because of claims mode. But I expected domain\groupname instead of SID. Is this the right behaviour.
    When I call SiteData.GetContent web service, I get the SID of the group name instead of the domain\groupname.
    Can someone please clarify?
    Thanks
    Naga

    Hi,
    Yes, the identity claim for an AD group is based on the SID of the group. The claim encoding for an Active Directory group consists of the following sections:
    c:0+.w|<SID>
    •"c" for a claim other than identity
    •"+" for a group SID
    •"." for a string
    •"w" for a Windows claim
    More information:
    http://www.sharepointfire.com/MyBlog/2013/11/get-ad-group-identity-claim-in-sharepoint-2013/
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • BO XI 3.1 : Active Directory Authentication failed to get the Active Directory groups

    Dear all 
            In our environment, there are 2 domain (domain A and B); it works well all the time. Today, all the user belong to domain A are not logi n; for user in domain B, all of them can log in but BO server response is very slowly. and there is error message popup when opening Webi report for domain B user. Below are the error message: 
           " Active Directory Authentication failed to get the Active Directory groups for the account with ID:XXXX; pls make sure this account is valid and belongs to an accessible domain"
          Anyone has encountered similar issue?
       BO version: BO XI 3.1 SP5
       Authenticate: Windows AD
    Thanks and Regards

    Please get in touch with your AD team and verify if there are any changes applied to the domain controller and there are no network issues.
    Also since this is a multi domain, make sure you have 2 way transitive forest trust as mentioned in SAP Note : 1323391 and FQDN for Directory servers are maintained in registry as per 1199995
    http://service.sap.com/sap/support/notes/1323391
    http://service.sap.com/sap/support/notes/1199995
    -Ambarish-

  • Add a mac to an active directory group using a script?

    I am managing a bunch of Macs and we are using Active Directory groups to assign certificates for 802.11x. I am binding the device to AD using JAMF software and was wondering if I could use a script to then add the deive to an active directory group.
    Thanks in advance...

    I think I misunderstood your question.  If you are trying to add the computer record to a location other than the Computers container, then just change your binding script to target the folder you want.  Remember that the user account you are using to bind must have access rights to this folder.
    For example, the sample command from the man page shows you how.  Say you have a subfolder inside Computers called Macs.  You would do this in your binding script.  Note the notation of an organizational unit within the Computers container.
    dsconfigad -a ThisComputer -u "administrator"
    - ou "CN=Computers,OU=Macs,DC=ads,DC=demo,DC=com" -domain domain.ads.apple.com
    Is that what you are looking to do?

  • Cannot Retrieve Active Directory Groups

    Hi All
    I recently connected my ACS deployment to Active Directory 2003. However when I try to add the active directory groups for group mapping, i.e. navigating to Users and Identity Stores > External Identity Stores > Active Directory > Directory Groups Tab and click select.
    My GUI on IE just loops and does not display anything(it does not freeze). On Firefox I receive "The connection was reset" error.
    Any ideas?
    Thanks in Advance

    Do you have the proper AD permissions set for the AD account used to join ACS to the domain?
    Note: AD account required for domain access in ACS should have either of these:
    Add workstations to domain user right in corresponding domain.
    Create Computer Objects or Delete Computer Objects permission on corresponding computers container where ACS machine's account is created before joining ACS machine to the domain.
    Thank you for rating helpful posts!

  • Windows Active directory group policy objects

    Like many small to medium businesses, we use Firefox in addition to Internet Explorer. The Windows Active Directory group policy objects we have for IE works nicely in all versions of IE. Firefox on the other hand has stopped playing ball. Any policy files I have found on the Internet simply does not fire when used in Windows Group Policy. We have Windows 2008 R2 servers with Windows 7 clients.
    Does Mozilla have official group policy objects that will work with Windows Active Directory group policy and is supported in Firefox versions 27 onwards? A lot of the material on the Internet are simply workarounds to achieve something simple.
    I believe this may have been asked several times already, but no definitive answer has been supplied to
    resolve the issue to my knowledge.
    Thanks and regards

    To my knowledge, Firefox historically has not had integration with group policy, and third party tools have been required to bridge the gap. You may have found templates that work in one of those tools.
    These threads have links to third party tools, articles, mailing lists, and other resources:
    * [https://support.mozilla.org/questions/980567 i need to include the Firefox Browser Configuration in my Group Policy and Control Proxy and Browsing Settings]
    * [https://support.mozilla.org/questions/978874 Is it possible to configure firefox using group policy]
    Please report back if you find a solution. Thanks.

  • Need to automatically add newly created user account in an existing active directory group.

    Hi All ,
    In my  environment we are having window server 2012 active directory environment.We need to have the newly created active directory user account to get added automatically to the existing active directory group after that new user account creation.
    Please tell us the possible ways to achieve this scenario.
    Regards
    S.Nithyanandham
    Thanks S.Nithyanandham

    Hi,
    Can you please confirm your requirement,
    When you create a new user account in AD, based on the user's property like Department, Job or Location, the user need to be added to your specific AD groups?
    Regards,
    Gopi
    JiJi
    Technologies

Maybe you are looking for

  • MacBook Doesn't Know When Battery Is Full Anymore?

    I noticed today that my MacBook's battery is no longer being recognized as full after the battery charges up... My battery reached what should be considered full, but as of now the light on the power adapter is still orange, the charge shows 99%, and

  • Smartforms print out problem

    hi all i am priniting a smartform with logo the problem is i a getting inverted logo where as verythn else id gd. can anyone suggest me what is going wromg regards navjot

  • Why we need to unload non-cumulative

    Dear all, why we need to unload non-cumulative cube. what are the step needed? Thanks V.G.VG

  • Oracle Discoverer Desktop Totals

    We had 9.0.2.39 desktop client and recently, we applied Upgrade 54 for Oracle Discoverer . With this version, totals does not seem to work properly. With 9.0.2.39, we have developed some discoverer reports having columns with TOTALS (tools->Totals->S

  • App Suggestions help

    Hi. Planning on getting an iPhone 5S/6 but i need help in suggestions for alternative apps with: 1. Music Player - I'm looking for a music player that has custom or user-defined equaliser settings, ability to transfer/receive files from a Macbook via