How to list users under multiple groups and users sub groups

Hi, I am stump, which is not hard to do. i have a list of groups and i want to list the users in those groups and then in the next column lists all the citrix only groups for each user. hopefully im describing that correctly. Heres what i have but it is
not listing the users groups. I am not sure how to proceed.
$CurrentDate = Get-Date
$CurrentDate = $CurrentDate.ToString('MM-dd-yyyy_hh-mm-ss')
$Groupname = "Distribution Lists"
$excel = New-Object -comobject Excel.Application
$excel.visible = $True
$wbook = $excel.Workbooks.Add()
$wsheet = $wbook.Worksheets.Item(1)
$wsheet.Cells.Item(1,1) = "Groupname"
$wsheet.Cells.Item(1,2) = "Member"
$wsheet.Cells.Item(1,3) = "ACID"
$wsheet.Cells.Item(1,4) = "Department"
$range = $wsheet.UsedRange
$range.Interior.ColorIndex = 19
$range.Font.ColorIndex = 11
$range.Font.Bold = $True
$intRow = 2
$groups = get-adgroup -Filter * -properties * -Searchbase "OU=Citrix,OU=Permission,OU=Groups,OU=Home Office,OU=domain,DC=Domain,DC=com"
$targetFile = "c:\temp\$groupname $CurrentDate.csv"
Add-Content $targetFile "Group;Member;ACID;Department"
foreach ($group in $groups){
$groupMembers = get-adgroupmember $group -Recursive | Get-ADUser -Properties Department, DistinguishedName| Where-Object { $_.Enabled -eq 'True' } | Select-Object Name, samaccountname, department, distinguishedname, @{n='MemberOf';e={$_.MemberOf -replace '^cn=([^,]+).+$','$1' -join '; '}
foreach ($groupMember in $groupMembers){
$groupName = $group.Name
$memberName = $groupMember.Name
$acid = $groupMember.samaccountname
$groups = $usergroups
#$department = $groupMember.department
$department = $groupMember.memberof
#$DistinguishedName = $gropmember.distinguishedname
$line = "($groupName)--------($memberName)-----($acid)-------($department)------($usergroups)"
add-content $targetFile $line
$wsheet.Cells.Item($intRow,1) = $groupName
$wsheet.Cells.Item($intRow,2) = $memberName
$wsheet.Cells.Item($intRow,3) = $acid
$wsheet.Cells.Item($intRow,4) = $groups
$wsheet.Cells.Item($intRow,5) = $DistinguishedName
$intRow++
$WorkBook.EntureColumn.AutoFit()
$excel.SaveAs("DL" + "name.xlsx")
$excel.Close()

Hi Glacket,
Below codes should give you headsup.
This command will give you estimate the result count for each group:
PS C:\Users\Administrator> Get-ADGroup -Filter {Name -like "TestGroup*"} | Select Name, @{Expression={get-adgroupmember $_ -recursive | Measure | Select -ExpandProperty Count};Label="Count"}
Name Count
TestGroup1 7
TestGroup2 8
Note that as said earlier we are getting duplicated results(12,13,14) for users belonging to multiple groups. Result is in order as per earlier code's count and order.
Get-ADGroup -Filter {Name -like "TestGroup*"} | get-adgroupmember -recursive | Select Name,@{Expression={Get-ADPrincipalGroupMembership $_ | Select -ExpandProperty Name};Label="GroupMemberOfName"}
Name GroupMemberOfName
User100 {Domain Users, TestGroup1}
User14 {Domain Users, TestGroup1, TestGroup2}
User13 {Domain Users, TestGroup1, TestGroup2}
User12 {Domain Users, TestGroup1, TestGroup2}
User11 {Domain Users, TestGroup1}
User10 {Domain Users, TestGroup1}
User1 {Domain Users, TestGroup1}
User19 {Domain Users, TestGroup2}
User18 {Domain Users, TestGroup2}
User17 {Domain Users, TestGroup2}
User16 {Domain Users, TestGroup2}
User15 {Domain Users, TestGroup2}
User14 {Domain Users, TestGroup1, TestGroup2}
User13 {Domain Users, TestGroup1, TestGroup2}
User12 {Domain Users, TestGroup1, TestGroup2}
Use below to export to CSV:
Get-ADGroup -Filter {Name -like "TestGroup*"} | get-adgroupmember -recursive | Select Name,@{Expression={Get-ADPrincipalGroupMembership $_ | Select -ExpandProperty Name};Label="GroupMemberOfName"} | Export-Csv C:\ListGroups.csv
Regards,
Satyajit
Please “Vote As Helpful”
if you find my contribution useful or “Mark As Answer” if it does answer your question. That will encourage me - and others - to take time out to help you.

Similar Messages

  • Powershell script for security groups and users for multiple share folders

    Hi scripting team,
    I need your help with powershell script for the below queries 
    1. List out the security groups for more than one server share path and output it to a file ( csv ) 
    For eg.
    If the are are two share paths 
    \\servername\foldermain\folder1
    \\servername\foldermain\folder2
    So I needs the list of security groups for each share path
    And the output needs to be under each any every path.
    2. Grab the users belongs to main security groups and it nested groups for more than one security group and listed the users under each and every group. No need to display nested groups. Just users belongs to main group and users under nested.
    Your teams help is much appreciated 
    Thank you.
    Thilochana kumararatne

    Hi Braham,
    Thanks for your quick reply.
    Are we able to do this on two stage method
    1. grab the security groups from the share paths
    if can grab the share path from a separate txt file than copying it to the <your path> location
    so i can modify the txt file
    once run the script
    if can the output like below to a CSV file
    \\servername\foldermain\folder1group 1group 2group 3\\servername\foldermain\folder2group 1group 2group 3then i know which groups belongs to which share paththen i can remove the duplicate groups and keep the common groups to grab the users belongs to itso with the second script same as the first copy the security groups to a txt file and the out put as below.what I needs is the users full name and the samaccount name ( user id )group 1user1user2user3
    group 2user1user2user3looking forward your help on thisThank you.Thilo

  • Best Practice in maintaining multiple apps and user logins

    Hi,
    My company is just starting to use APEX, and none of us (the developers) have worked on this before either. It is greatly appreciated if we can get some help here.
    We have developed quite a few applications in the same workspace. Now, we are going to setup UAT and PRD environments and also trying to understand what the best practice is to maintain multiple apps and user logins.
    Many of you have already worked on APEX environment for sometime, can you please provide some input?
    Should we create multiple apps(projects) for one department or should we create one app for one department?
    Currently we have created multiple apps for one department, but, we are not sure if a user can login once and be able to access to all the authenticated apps.
    Thank you,
    LC

    LC,
    I am not sure how much of this applies to your situation - but I will share what I have done.
    I built a single 700+ page application for my department - other areas create separate smaller applications.
    The approach I chose is flexible enough to accomdate both.
    I built a separate access control application(Control) in its own schema.
    We use database authenication fo this app - an oracle account is required.
    We prefer to use LDAP for authentication for the user applications.
    For users that LDAP is not option - an encrypted password is stored - reset via email.
    We use position based security - priviliges are based on job functions.
    We have applications, appilcations have roles , roles have access to components(tabs,buttons,unmasked card numbers,etc.)
    We have positions that are granted application roles - they inherit access to the role components.
    Users have a name, a login, a position, and a site.
    We have users on both the East Coast and the West Coast, we use the site in a sys_context
    and views to emulate VPD. We also use the role components,sys_contexts and views to mask/unmask
    card numbers without rewriting the dependent objects(querys,reports,views,etc.)
    The position based security has worked well, when someone moves,
    we change the position they are assigned to and they immediately have the privileges they need.
    If you are interested I can rpovide more detail.
    Bill

  • Create users under Administration Server Create user and Refresh users options are disabled

    We have installed and configured 11.1.2.2 successfully, Essbase in standalone mode.
    When we try to create users under Administration Server Create user and Refresh users options are disabled. Please let me know how to create EAS users?
    Thanks,
    Satheesh.

    Please find below response.
    1.You can create users from EAS console using maxl, if you have not externalized the users .
    When we create using Maxl it will create for 'ESSBASE Servers' users but we want to create additional administrator users under 'Administrator Services' --> 'Users'. At the moment default 'Admin' users is created under 'Administrator Services' --> 'Users'.
    2.  you have installed your essbase in a stand -alone mode  , then the option of creating users will be enabled and you can give appropriate provision to applications.
    Yes. But the create users is disable for Admin.
    3. Through which url are you accessing EAS console is it http://Servername:19000/workspace/index.jsp ?
    http://prod-server:10080/easconsole/console.html
    Please suggest.

  • Pt:tree of community groups and users

    I am creating a community emailer portlet for emailing the users of a community. I want to use a pt:tree that lists the groups and users who have membership in the community. I want the individual users, groups and users in groups to be checkable. I've been playing with the pt:tree for a while now without success. Can anyone help? This seems like it would be a common question, but I can not find any answeredthreads on this. Thank you!

    "Vikram" <[email protected]> wrote in message
    news:3eb6f601$[email protected]..
    >
    Hi,
    We are having problems seeing users or groups in our LDAP repository, thruWLS(7.0
    sp2) console. I created a Custom Security Realm(myRealm) in which I addedthe
    Novell LDAP Authentication provider as one of the authentication providersbesides
    a Default Weblogic Authentication Provider (for system user account). WhenI click
    on Users or Groups, I see either the "system" user account or"Administrators,
    Deployers, Operators, Monitors" groups.These groups and user accounts areprovided
    by the Weblogic Default Authentication provider. I am unable to see any ofour
    LDAP groups or User accounts. If I try to login to the WLS console with anLDAP
    user account, the authentication goes successfully. So WLS isauthenticating the
    user correctly but is not displaying the User and Group information in theconsole.
    We need to be able to look at the Group information in order to configurea Group
    Portal.
    Just out of curiosity, I configured an LDAP authentication provider in theCompatibility
    Security Realm and I was not able to see any of our LDAP users or groupsin the
    Compatibility Secyrity Realm also. I did reboot the WLS after configuringthe
    LDAP authentication provider in both the cases.
    I would appreciate if anybody can suggest probable reasons or workaroundsto list
    the LDAP groups in the WLS 7.0 console.
    I believe this is fixed in the latest 7.0 sp.

  • How to find screen group and subsequent screen group from program number

    Hi all there,
    Can anybody tell me how to find out screen group and subsequent screen group from program number.
    I need it to find next screen number in VF01 transaction
    I am doing recording in VF01 after entering delivery number which is on screen number 0102 and pressing enter sometime it goes to screen number 0103 and sometime it goes to screen number 0104
    I wanted to find out on what condition it goes to these screen
    Regards
    Sagar

    hi,
    for konwing the screen flow you ...just use the press (ctrlshiftF5) now you will get the flow ...now just click on screen number 102 then go inside the PAI by double clicking on user command...
    search for screen numbers 103 or 104 now check on what condition it will get tirrgered..
    with regrads
    janani

  • Is there a way to create an automated job to add andupdate groups and users for Connect?

    Is it possible and does anyone have experience with being able to create an automated load of new groups and users in Adobe Connect. We have an On-premise deploymentwill be setting up  the application to be open outside our company to train channel partners. We have a separate database of channel partner contacts, email addresses, passwords, and training groups that they should be in based on their partner company or product knowledge. We would like to be able to create a front end database that would create a group based on the partner company or based on product knowledge. Then we would like to add users to these groups. Any knowledge of whether this is possible and if anyone has done it?

    There are also size limitations or rather suggestions for particle size. If I were creating an animated 3D shape using Form or C4D and wanted to use it as a particle I would keep the size of the particle about 1/6 to 1/8 of the comp size. You would create a new comp for your particle, animate it, then nest the particle comp in your main comp, turn off visibility, and then use it as a particle in Particular.

  • Migrating groups and users from QA to Production

    Post Author: KSK
    CA Forum: Administration
    Hi,
    I have to migrate security setup with Groups and users from QA to Production box .
    setup is in Unix.
    Note: my production already have some other projects related groups and Unix.. and when I say migrate, i just want to add the groups from qa to append or add to production with exsiting setup and not to overwrite..
    any help is greately appericated
    thanks
    KSK

    Post Author: andyskinner
    CA Forum: Administration
    Use the migration wizard and set it to merge, the deltas should be added ok and anything that exists in both systems should get a number added at the end.

  • Groups and users are not showing up in Hyperion workspace

    Hi There
    I am having problem with the workspace when trying to give access to reports.Problem is its not showing up groups and users in workspace.But when i tried logging to shared services its showing up all the groups and users.Its trying to communicate with native directory but not with the openldap.
    Please help me.
    Thanks
    Harsha.

    Hi,
    Have you provisioned the users/groups in shared services with the correct Reporting & Analysis roles?
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Add field group and Logical field group for ANLU

    Hi all,
    On my project, the table ANLU is containing many specifics fields.
    I would like to know how I could add a field group and logical field group corresponding to this specifics fields on ANLU, in order to be taking into account on my validation rule ?
    On the GGB0, Asset Accounting / master data, the check point includes the ANLU on the table fields. But, once my rule created, when I want to activate it on the TCODE OACV, the field group proposed don't include data from ANLU (only ANLA and ANLB)
    I found out the TCODE OAVM listing all different field linked to the field group. Does it possible to manage this view ?
    please help me !!

    Hi Rob,
    Can you tell me how can i solve this issue.
    Runtime Errors         MOVE_TO_LIT_NOTALLOWED
    Date and Time          09/11/2007 18:11:01
    Short text
        Assignment error: A constant was meant to be overwritten.
    Error analysis
        The field "<S1>" is to be assigned a new value although the field
        is partially or entirely protected against modifications.
        The following are protected against changes:
        - Character literals or numeric literals
        - Constants (CONSTANTS)
        - Parameters of the category IMPORTING REFERENCE for functions and
        methods
        - Untyped field symbols not yet assigned a field using ASSIGN
        - TABLES parameters if the actual parameter is protected against changes
        - USING reference parameters and CHANGING parameters for FORMs, if the
        actual parameter is protected against changes and
        - Accesses using field symbols if the field assigned using ASSIGN is
        protected (or partially protected, e.g. key components of an internal
        table with the type SORTED or HASHED TABLE) against changes
        - Accesses using references, if the field bound to the reference is
        protected (or partially protected) against changes
        - External write accesses to READ-ONLY attributes,
        - Content of a shared object area instance accessed using a shared lock
        (ATTACH_FOR_READ).
    Thanks
    Ashraf

  • Table name for Internal order group and Profit center group

    Hello Friends,
    Could any one provide me the table for Internal order group and Profit center group.
    We are developing new customized report and user requested internal order group and Profit center group in the selection criteria.
    I have checked for this tables but found only these fields in structures.
    Thanks in advance,
    Ravi Kiran.

    Or use FM [G_SET_TREE_IMPORT|http://www.sdn.sap.com/irj/scn/advancedsearch?query=g_set_tree_import] to read the hierarchy/Group. (Read FM and FG documentation, you can also add break-point and call some S_ALRxxx transaction which use this FM for the objects you need).
    Regards,
    Raymond

  • Issue on profit center group and profit center group hierarchy

    hi experts
    I have a requirement where i have profit center,profit center group and profit center group hierarchy.
    profit center group and profit center group hierarchy are same?if they are same how to get them into BI.if they are not same how to get them into BI
    im using two datasources 2lis_11_vaitm and 2lis_12_vcitm,how to connect the profit center group and profit center group hierarchy with the datasources,My dataflow is on top of these datasources there are two write optimised dso and on top of those w-o dso there are std dso and on top of the std dso there is a infocube.on infocube there is multiprovider
    Thanks,
    sivaram

    Hi Sivaram,
    Profit Center would be an attribute of any object which is used in the 2lis datasources. maybe CO Order or WBS etc...from these objects Profit Center should be or could be made as navigational attribute.
    Further you can load the master data and hierarchy from the datasource 0PROFIT_CTR_0106_HIER
    Hope this helps.
    Good Luck.
    Vikram

  • Account Group and Cash Mgmnt group in vendor

    Hi,
    What the purpose of the "account group"  and " Cash mgmnt group "  when I create a Vendor using XK01.
    Tks,
    Sandra Amadi

    Hi Sandra
    Account group is basicaly use for segregarion of vendors based on their relation with Business.  It is a purely business decission for easy and user freindly reports of and control of vendors.
    find more at SAP help at beow link
    http://help.sap.com/saphelp_47x200/helpdata/en/53/c98647ca3711d2b494006094b9114a/frameset.htm
    In cash management, customers and vendors are allocated to planning groups by means of an entry made in the master record.
    for example:
    R1  Customers paying by bank collection
    R2  Other domestic customers
    R3  Customers abroad
    R4  Affiliated company customers
    R5  High risk customers
    R6  Major customers
    R7  Rental income
    R8  Repayment of loans
    E1  Domestic vendors
    E2  Vendors abroad
    E3  Affiliated company vendors
    E4  Major vendors
    E5  Personnel costs
    E6  Taxes
    E7  Investments
    Hope this info will helpful for you.
    best regards
    S.Habib Pasha.

  • Accoutning Groups and Profit centre groups

    Hi All,
    Please help me in this issues..
    1) Is there any way to get all accounts in accounting group by specifying controll area and accounting group.
    2) Is there any database table which stores accounting group and profit center group together.. or is there any way to pick accounting group for particular profit center group and vice versa..
    please help me

    Hi,
    SETNODE and SETLEAF are the tables which contains All groups like Cost center, Profit Center and accounting groups etc and their related Cost center, profit center and Accounts.
    By writing the Nested selects for this we can retrive all the accounts, CC's and Profit centers from it.
    CC Group = '101' and PC Group = '0106' etc
    Or you can use the following fun modules:
    G_SET_TREE_IMPORT
    G_SET_GET_ALL VALUES
    Regards,
    Anji

  • Customer Groups and Customer Credit Groups

    Hello
      I was going through the documentation for Credit Management, but I was confused on what the difference was between customer groups and customer CREDIT Groups.. both of them sort of have the same definition, then what is the difference ?
    Please help me out.
    Regards,

    Hi Raj,
    For your info :
    The <b>credit group</b> groups together different business transactions which should be dealt with in the same manner with regard to the credit check.
    You enter the credit groups when you configure the sales document types for credit management and define the automatic credit check.
    Default settings
    The following credit groups are contained in the standard SAP R/3 System:
    01 = credit group for sales order
    02 = credit group for delivery
    03 = credit group for goods issue
    Actions
    1. Check whether you can use the credit groups in the standard system.
    2. If you need to create new credit groups, enter an alphanumeric key with two characters and a descripion for the credit group.
    A <b>customer group</b> tells to which a customer can belongs to.
    You specify the customer group for sales data in the customer master record for each sales area.
    The SAP System copies this specification automatically into the sales documents at header and item level. Here, you will find the customer group on the detail screen for general business data.
    Actions
    1. Specify an alphanumeric key which can have up to 2 characters and a description for the customer groups.
    2. Make sure that the customer groups are entered in the customer master records.
    Hope it helps. Pl reward if useful.
    Thanks & Regards
    Sadhu Kishore

  • Employee Group , Employee Sub Group and Pay Scale Group

    Hi Experts,
    In which table or feature we are grouping
    Employee Group , Employee Sub Group and Pay Scale Group
    Thanks in Advacne.
    Regards,
    IFF

    Hi
    All groupings are based on the SAP HR sub modules like for Time fro Personal work schedule we group in table  V_001P_N
    So for each sub module we have different table.
    Please specify your exact requirement.
    Thanks
    Sheetal

Maybe you are looking for

  • How do I use my iPhone 5 as a router for my iPad?

    How do I use my iPhone 5 as a router for my iPad?

  • My iphone stopped downloading apps! :S help me

    Hello! my iphone stopped downloading apps that when i go to download i press install and it shows the download on home screen and "Waiting..." then it hides and go away from screen!!! help me i tried many apps but same problem that happened suddenly

  • FDM is not supported on Oracle RAC?  Why not?

    [http://download.oracle.com/docs/cd/E12825_01/epm.111/fdm_11113_readme.pdf|http://download.oracle.com/docs/cd/E12825_01/epm.111/fdm_11113_readme.pdf] We are in the process of implementing Oracle Hyperion Financial Data Quality Management (FDM) versio

  • NAC Agent reporting never shows a failure

    I seem to only get reports for successful agent logins under Device MGMT>Clean Access>Clean Access Agent>Reports.  Am I missing a setting somewhere?  Even though I have had many failures (testing, etc) I never see a failed report.  Any ideas?

  • XI & BI - /BIC field problem

    Hi, I am trying to push dat into BW from XI. everything is working well except for fields that are customized in BW that start with /bic and therefore are not papulated in the BW. does anyone have a solution?