Get members by group from a forest

I have multiple domains in our forest and I'm trying to pull a list (csv) of all the members of groups with a PCSupport in the name.
I've been able to get the groups or members of the group in my specific domain but not the others.
One or the other and haven't been able to put it all together. This has gotten me the farthest along, I've got all the groups listed, but I don't know how to feed this into additional scripting to get the groups and members into a csv.
Thanks in advance for any help
$forestName = ([System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()).Name
$ADsPath = [ADSI]"GC://$forestName"
$Search = New-Object System.DirectoryServices.DirectorySearcher($ADsPath)
$Search.Filter = "(&(objectCategory=group)(SamAccountName=*PCSupport))"
$Search.FindAll()
Path                                                                        
Properties                                                                
GC://mycompany.com/CN=PCSupport,OU=Groups,DC=domain1,DC=mycompany,DC=com             {samaccountname, objectsid, instancetype, objectclass...}                 
GC://mycompany.com/CN=Co-_PCSupport,OU=Groups-Reserved,OU=ServerWorkstations,D... {info, samaccountname, objectsid, instancetype...}                        
GC://mycompany.com/CN=PCSupport,OU=Groups,DC=domain2,DC=mycompany,DC=com                  {samaccountname, objectsid, instancetype, objectclass...}                 
GC://mycompany.com/CN=PCSupport,OU=Groups,DC=domain3,DC=mycompany,DC=com       {samaccountname, objectsid, instancetype, objectclass...}                 
GC://mycompany.com/CN=PCSupport,OU=Groups,DC=domain4,DC=mycompany,DC=com                {samaccountname, objectsid, instancetype, objectclass...}                 
GC://mycompany.com/CN=PCSupport,OU=Groups,DC=domain5,DC=mycompany,DC=com                 {samaccountname, objectsid, instancetype, objectclass...}                 
GC://mycompany.com/CN=PCSupport,OU=Groups,DC=domain6,DC=mycompany,DC=com        {samaccountname, objectsid, instancetype, objectclass...}                 
GC://mycompany.com/CN=PCSupport,OU=Groups,DC=domain7,DC=mycompany,DC=com               {samaccountname, objectsid, instancetype, objectclass...}                 
GC://mycompany.com/CN=PCSupport,OU=Groups,DC=domain8,DC=mycompany,DC=com                   {samaccountname, objectsid, instancetype, objectclass...}                 
GC://mycompany.com/CN=PCSupport,OU=Groups,DC=domain9,DC=mycompany,DC=com            {samaccountname, objectsid, instancetype, objectclass...}                 
GC://mycompany.com/CN=PCSupport,OU=Groups,DC=domain10,DC=mycompany,DC=com                  {samaccountname, objectsid, instancetype, objectclass...}                 
GC://mycompany.com/CN=PCSupport,OU=Groups,DC=domain11,DC=mycompany,DC=com        {proxiedobjectname, samaccountname, objectsid, instancetype...}           
Tom

Hi Tom,
For example I use this expression to get members from a group and works fine for the CSV.
Import-Module ActiveDirectory
Get-ADGroupMember -identity "<group>" | select name | Export-csv -path C:\output\members.csv -NoTypeInformation
I think the | Export-csv -path is what you are looking for

Similar Messages

  • How to get members in group

    Hi,
    How can i get the members in a group using java mail API
    I have used:
    InternetAddress internetAddress = new InternetAddress("[email protected]");
    InternetAddress.getGroup(true);
    it is not working .....
    Note: XXX is the group name
    whether i have to change the config property file
    Can anyone help me out ..
    Regards
    Ganesan S

    Get the "uniquemember" attribute of this entry..

  • How to get cost center group from cost center

    Hello
    I have cost center and i need to get the cost center group.
    Anyone having an idea how to get it???
    Thanks
    Parvez

    Hi,
    Cost centre could be assigned to different cost centre groups. For standard hierarchy, you can retrieve it from CSKS table, but for other groups SETLEAF table (class 0101) will provide you a complete answer.
    Regards,
    Eli

  • Get All Groups from Weblogic

    Hello everyone,
    Well i'm having little problem to get all groups that exists in Weblogic. I already search but the only thing i can get is the groups from the user that is autenticated in the application.
    Best regards,
    Tiago Marques

    See if this helps - http://weblogic-wonders.com/weblogic/2010/11/10/list-users-and-groups-in-weblogic-using-jmx/

  • Sharepoint 2010 get User Groups from specific site

    Hello,
    I was able to get all User groups from entire site Collection.
    But instead of getting user groups from entire site, I want read user groups only from one specified sub site.
    Please help!
    Thanks

    Assuming you have an SPWeb object named "web", example:
    SPSite site = new SPSite(http://yourdomain/sites/yoursite);
    SPWeb web = site.OpenWeb("mysubsite/subsbusite");
    web.Groups will return a collection of SPGroup objects for the current subsite. If this subsite inherits permissions from a parent site (web.HasUniquePerm = False), the list is the same as the Groups property of the parent site.
    SPWeb.Groups:
    http://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.spweb.groups(v=office.15).aspx
    SPGroup:
    http://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.spgroup(v=office.15).aspx
    You would be better results by posting coding questions in "SharePoint 2010 - Development and Programming" instead of "SharePoint 2010 - General Discussions and Questions".
    Mike Smith TechTrainingNotes.blogspot.com
    Books:
    SharePoint 2007 2010 Customization for the Site Owner,
    SharePoint 2010 Security for the Site Owner

  • Get all groups from an AD Server

    Hi everyone,
    I'm trying to get all groups from and AD server.
    Here's how I'm doing it:
    DirContext ctx = new InitialDirContext( (Hashtable<String,String>) env);
              Name n2 = new CompositeName().add(groupsContainer);
              NamingEnumeration<Binding> contentsEnum = ctx.listBindings(n2);
              int i = 1;
              while ( contentsEnum.hasMore() && (i++) < 1000 )
                   Binding binding = contentsEnum.next();
                   groups.add(binding.getName().substring(3));
              return groups; The problem is, I always get an error if I don't restrict the results number to below 1000.
    The error is the following *javax.naming.SizeLimitExceededException: [LDAP: error code 4 - Sizelimit Exceeded];*
    After googling, I found it it's due to a field in the AD Server, that restrict the result number.
    So there is no way that I can obtain all groups without changing that field?
    Regards,
    Nuno.

    Hi Nuno,
    You have to increase the MaxPageSize value at ActiveDirectory level to retrieve results more than 1000. By default the MaxPageSize value is 1000. There is no option other than increasing the MaxPageSize value.
    Thanks & Regards,
    Murali.
    ============

  • How to get list of groups and the users from OID

    Hi,
    Can someone please tell me how to get the list of GROUPS and all the USERS in each group in OID using Java. Need to recursively get all the Groups and Users in each group using Java any samples.
    Thanks

    use examples from OTN like
    http://www.oracle.com/technology/sample_code/products/jdev/readmes/samples/ldapdatacontrol/ldapapplication/src/dc/ldap/model/LDAPSearch.java
    and modify it to your needs
    Bernhard

  • How to get the member of cost element group from Profit center group

    Hi Guys,
                  I need to get the member of cost element group from Profit center group like in Tcode KCH3 and the same from Account Group like in Tcode KDH3.
    Any Function Module available to get this data.
    Thank U for Ur time.
    Cheers
    Senthil

    I am closing this thread.

  • Error while getting the Direct parent group from IUser

    Dear all,
    I'm using KM API's to upload documents to KM through a Webdynpro Application.
    The uploading of the document is working correctly.  the permission setting to the newly uploaded document is done based on user group in which the user is a member.
    This is also working.
    While uploading, the  user gets a selection screen to choose the area.
    If the user is a member of All India that person will get option to select all branches and all areas under each branch.
    If the user is a member of any one branch, he can select only areas coming under his branch.
    Here the problem starts. (All India is the parent group for all branches,  under branch some areas are there.)
    User 1 is a member of All India
    User 2 is a member of Branch1
    If an All India user comes in we give the branch list in a dropdown list. Branch user should not get this dropdown. He's not supposed to upload documents for any other branch.
    I am checking the parent group of the user identify his Level. But even if the user is not a member of All India, I'm getting the dropdown to choose the branch.
    Please give me your valuable guidance to solve this.
    My code for getting the parent group is given below.
    public com.sapportals.portal.security.usermanagement.IGroup getParentGroup( com.sapportals.portal.security.usermanagement.IUser ep5User )
        //@@begin getParentGroup()
            String [] parentGrp=null;
            IGroup parentGroup=null;
            try
                 IGroupFactory groupFact=WPUMFactory.getGroupFactory();
                 /* Get all the User groups in which the user is a member */
                 String [] userGroup=ep5User.getDirectParentGroups();
                 for(int i=0;i<userGroup.length;i++)
                      IGroup userGrp=groupFact.getGroup(userGroup<i>);
                      if(userGrp.getId().startsWith("B00") || userGrp.getId().equalsIgnoreCase("ALL_INDIA"))
                           msgMngr.reportSuccess("ID of the group "+userGrp.getId());
                           parentGroup=userGrp;
                           break;     
            catch(UserManagementException e){
                 msgMngr.reportException("UserManagementException"+e,false);
            return parentGroup;
        //@@end
    Best Regards,
    Aparnna

    I found a solution. Not sure if its the correct one.
    Used the com.sap.security.api.IUser and used the below code to check if the user is a member in group
    IUser user=WDClientUser.getCurrentUser().getSAPUser();
                   com.sap.security.api.IGroup grp=UMFactory.getGroupFactory().getGroupByUniqueName("ALL_INDIA");
                   if(grp.isGroupMember(user.getUniqueID(),false))
    //code to be executed if the user is a member
    Best Regards
    Aparnna

  • SQL Query to get All AD Groups and its users in Active Directory

    Hi,
       Is there any query to get all AD groups and its user in an instance of a SQL server?

    Check this blog.
    http://www.mikefal.net/2011/04/18/monday-scripts-%E2%80%93-xp_logininfo/
    It will give you more than what is required. If you dont want the extra information,then you can try this.. I took the query and removed the bits that you might not require.
    declare @winlogins table
    (acct_name sysname,
    acct_type varchar(10),
    act_priv varchar(10),
    login_name sysname,
    perm_path sysname)
    declare @group sysname
    declare recscan cursor for
    select name from sys.server_principals
    where type = 'G' and name not like 'NT%'
    open recscan
    fetch next from recscan into @group
    while @@FETCH_STATUS = 0
    begin
    insert into @winlogins
    exec xp_logininfo @group,'members'
    fetch next from recscan into @group
    end
    close recscan
    deallocate recscan
    select
    u.name,
    u.type_desc,
    wl.login_name,
    wl.acct_type
    from sys.server_principals u
    inner join @winlogins wl on u.name = wl.perm_path
    where u.type = 'G'
    order by u.name,wl.login_name
    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

  • Need to migrate Shared services users and groups from 9.3.1 to 11.1.2.2 ver

    Hi All,
    We need to migrate Shared services users and groups from 9.3.1 to 11.1.2.2 version. Any help would be appreciated. Can we use CSS import export utility?
    Thanks in advance!!

    Hi John, In my another environment I have to migrate the users and groups from Hyperion HSS 11.1.1.2 to Hyperion shared services 11.1.2.2. I am using LCM for that, when I export the users and gropus from 11.1.1.2, it exports fine but when i import it to my 11.1.2.2 using LCM, I am getting the below errors.
    Error when I try to import the groups:
    ErrorEPMIE-00051: Failed to perform operation on role. Could not locate role matching filter {0} and filter attribute {1}. Please ensure that a role exists matching the filter with filter attribute.
    EPMIE-00024: Failed to import all of the membership info for group test group. Invalid group members encountered. Please ensure the validity of members and its existence in their respective providers.
    Errors when i try to import the users:
    ErrorEPMIE-00051: Failed to perform operation on role. Could not locate role matching filter {0} and filter attribute {1}. Please ensure that a role exists matching the filter with filter attribute.
    EPMIE-00020: Failed to update user 04668162 during import. Invalid identity for user. Please ensure that the user is available in the system with the identity specified in the import file.
    Any idea?
    Thanks in advance.

  • Combing members to group on one line

    HI,
    I am running into a problem that I hope somebody can help with. I am using CR 2008 with BW as a datasource. What I am attempting to do is combine multiple members from one dimension and then group on that set in one line.  I have been able to combine the members using both the concatenate function and also a combination of text variables but when I group on the set what I get  is (assuming the set is members A,B,C)
    Key Figure
    GH1 Member A      10
    GH1 Member B       20
    GH1 Member C       40
    What I am looking for is
    Key Figure
    GH1 Member A,B,C            70
    It seem like the makearray function might work but when I try to do that I get an error message saying that "the result of a formula cannot be an array".
    As always, any help would be greatly appreciated.
    Thanks,
    Andy
    Edited by: Andrew Mast on Feb 12, 2010 3:27 PM
    Edited by: Andrew Mast on Feb 12, 2010 3:36 PM
    Edited by: Andrew Mast on Feb 12, 2010 3:37 PM

    Hi Jason,
    Thanks for the info. I am very new to crystal reports so please forgive me if I am readng the formula incorrectly but I do not think that variable will work for what I am trying to do. It appears that variable is building an array of all customer ids that resets each time the group data item(country changes). I am trying to combine two specific members  and group them on one line with a total for both members.
    The report I am building requires a crosstab set up with each line being a specifc node (and in one case 2 nodes) on a hierarchy. The problem is that the layout is not the same as the hierarchy layout so that node 14 of the hierarchy is placed after node 18 so I can't just group on the hierarchy. Grouping by specified order isn't working for me (or I can't make it work for me) for a host of reasons.
    Anyway, I have been able to specify the individual nodes by creating a variable to pull the hierachy node names. I then created a series of If then statements like
    If {node variable} = "Node 14" then "Node 14" else null. I then group on each of the individual formulas and suppress null values. This works great except for the one row that is comprised of 2 nodes. 
    Like I said I can write a statement that pulls both nodes together but when I group on that item they get split back into 2 seperate rows rather than just one with the total for both members . 
    Once again, thanks for your input.

  • Separating a child domain from a forest/parent domain

    Our infrastructure is currently as follows:
    There are two domains which I will call "apple.local" and "banana.local". The domain "apple.local" is the parent/forest which is at a Windows 2003 Functional Level. The domain "banana.local" is a child domain of "apple.local"
    which is at a Windows 2008 Functional Level. This unusual arrangement was the result of a merger.
    Recent business changes have meant that the domain "banana.local" needs to become the forest and "apple.local" needs to be permanently retired. I have been searching as to whether this is possible but the general consensus is "no".
    However, many of the discussions are several years old and I am interested in whether anything has changed with recent updates.
    As an added "bonus", a single Exchange 2010 SP3 server is present and - just to complicate things further - is a member of the child domain "banana.local". Mailboxes (shared and user) and DGs from both domains are present. Access to shared
    mailboxes is granted using a mixture of users and security groups from both domains.
    Is the best way forward to simply create a new domain on a fresh server? What would be the most straight-forward solution with minimal impact to the users and - in particular - the Exchange platform?
    I am in a position to purchase new servers, software and licenses as required to meet the ultimate goal and - within reason - additional expenditure is not an obstacle. We also have the option to create new IP ranges if required.
    Any ideas and/or suggestions welcomed!

    Is the best way forward to simply create a new domain on a fresh server? What would be the most straight-forward solution with minimal impact to the users and - in particular - the Exchange platform?
    It is not possible to detach a child domain from its parent. One of the things you can do is to create your domain and establish trusts between them and migrate resources from old domain to the new domain. Note that computer account migration will take some
    time. For exchange part you can ask in Exchange forums but the one thing you can do is to Cross-Forest mailbox move after you set up the new forest.
    Exchange 2010 Cross-Forest Mailbox Moves
    Mahdi Tehrani   |  
      |  
    www.mahditehrani.ir
    Please click on Propose As Answer or to mark this post as
    and helpful for other people.
    This posting is provided AS-IS with no warranties, and confers no rights.
    How to query members of 'Local Administrators' group in all computers?

  • FinRep 9.3.1: All users getting error opening reports from root directory

    We are having an irritating, although not missiion critical error
    When a user (any user) attempts to open a report from the explorer view in Financial Reporting 9.3.1, we receive an "_Error 1000165"._ No explanation is provided. No folders are openable within the explorer view except "Personal Page."
    It is possible to open reports by opening a report that got accidentally stored in the root directory and then opening another report from the menu system in the usual way. So it is not a user permissions/provisioning issue.
    Is there a fix to this? I am afraid someone will clean out the root directory and then we won't be able to access our reports.
    Update: I can use the pattern "VariancePercent([B(A)],[A(A)])" to cut this to 27 Columns by varying the direct reference to the column. But is there an easier way to do this?
    Edited by: user10868938 on Feb 24, 2009 3:43 PM

    We have been able to complete the update of our users SSID's in our Planning SQL tables through the utility. We had to create the users in Essbase first though.
    However, if I try to log into Planning (through Workspace) I still cannot see the Planning applicaitons I should have access too. In Shared Services if I pull up my network ID and View Report, I do not get any Planning groups to show up that I belong too. I can open the group in HSS and see my ID is in it but when I do the View Report on my ID nothing comes up.
    Additionally, if I add a user from scratch to the existing Planning groups that we've migrated and do the View Report they will show up for that user and the security passes through to Planning/Essbase so that I could log on fine. So, the problem is not with adding new users but the existing one's that were migrated. HSS shows the users in the groups but if you view a Report for those users it doesn't look like you belong to any groups.
    We are going to apply a patch to Shared Services to see if it helps. It's suppose to deal with Groups that have users from multple domains but one set of those users cannot log into the application they should have access too. We applied this in our stand-alone S9 Essbase environment a couple of months ago to deal with a break between our existing users and groups from HSS to Essbase. Maybe this will be the final piece.

  • How to get calendars and notes from my iPhone into iCloud?

    Hello all,
    yesterday I got a new MacBook Pro Retina at work. This upgrade me to OSX 10.8 from 10.6, so I planned to use iCloud to sync my iPhone 5 and my Mac this way. So far I synced the devices manually via iTunes.
    However, so far I only got Contacts to sync with iCloud correctly. Calendars and notes just don't do it, although their sync is turned on on the iPhone as well as on the Mac.
    All my attempts to get it to work obviously destroyed the possibility to sync calendars via iTunes - after a sync there is just nothing showing up in Calendar. This is really bad as now I can only access my calendars via the iPhone.
    Since my iPhone now contains the most recent calendar and note data the question is even more simple: how can I get these data from my iPhone into iClous so they will also sync with my Mac (and from then on on all devices)?
    It doesn't work by just turning calendar sync on on the iPhone. When I do this, I now see two calendar groups "From my Mac" and "From iCloud". Great, but what I want is to replace "From iCloud" with "From my Mac".
    I have already reset iCloud, but this didn't help either.
    I'm close to desperation, so any hints are very much appreciated!
    Thanks and best wishes,
    Thomas.

    Solved - it was a general sync problem. Today I was not even able anymore to sync my calendars via iTunes. Problem and solution see https://discussions.apple.com/thread/5505069.
    Best,
    Thomas.

Maybe you are looking for

  • My HP PSC 1315 Cartridge Error Does Not Respond To Troubleshooting

    My printer  HP PSC 1315 has never given me problems. About a month ago I replaced the black ink cartridge (it was all I could afford). It was working fine and then out of the blue it came up with an error saying to check my cartridges. I did. Nothing

  • Can't install 9/23/2005 updater-no firmware image? ARGH!!!!

    So the story begins...we've supposedly installed the ITunes 5.whatever update. Husband tells me he can no longer put purchased music on IPod, because it's out of date. So I open the IPod Update 9-23-5005 and (I think) install it on the hard drive. No

  • Help - Focuslost is trigered too many time during jtextfield validation.

    Hi all, I am designing a form containing multiple fields with field validations. The program supposes bring the focus back to that particular field after the error message is displayed. However; the error/warning message is displayed infinitely betwe

  • IPod and iTunes - Duplicate song file problem

    I have many songs on my iPod that are the same. Is there an easy way to do a search and delete of all duplicate songs in one easy step, either thru the iPod itself, or iTunes? Thanks in advance for your help! Keith in MI

  • Unable to see SAP UR Design/Themes perspective

    HI All, I am following this tutorial to change themes in webdynpro java: https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/ccb6bcf4-0401-0010-e3bc-ec0ef03e13d1 I am using NWDS 7.0.09. I have downloaded theme editor plugins for 2004s