Check group membership and export result to file

Hi everyone,
Could you please assist?  I need a script that get's a samAccountName from a text or csv file, then checks if the user belongs to Group A or Group B or Group C.  If user belongs to group A, then output "Group A" and so on.  Sample
output file:
JDoe Group A
JSmith Group B
KSmith  Group C
DDoe Group A Group B Group C
Thanks in advance,

Hi Phathuynh,
We always recommend you can start your own script, and post the current script and the issue for a better response.
In addition, you can also refer to the cmdlet "Get-ADGroupMember" to list the members in group, and the script below is for your reference:
$output = @()
$groups = "user1","user2"
$array1 = Get-ADGroupMember Group1|select -ExpandProperty samaccountname
$array2 = Get-ADGroupMember Group2|select -ExpandProperty samaccountname
Foreach($u in $groups){
$user = Get-ADUser $u|select -ExpandProperty samaccountname
$param = @{"user" = $user
"group A" = ""
"group B" = ""}
$p = New-Object Psobject -Property $param
if ($array1 -contains $user){
$p."group A"= "YES"
if ($array2 -contains $user){
$p."group B" = "YES"
$output += $p
$output
The screenshot of result:
If there is anything else regarding this issue, please feel free to post back.
Best Regards,
Anna Wang
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 Support, contact [email protected]

Similar Messages

  • Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the rows? Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the records?
    Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    The Oracle documentation has a good overview of the options available
    Generating XML Data from the Database
    Without knowing your version, I just picked 11.2, so you made need to look for that chapter in the documentation for your version to find applicable information.
    You can also find some information in XML DB FAQ

  • I get the error message in QuickTime "operation stopped the operation is not supported for this media" most times when I try and export an .AVI file as something else (.m4v). I have not touched the file in any way (no trimming, clipping or other editing)

    I get the error message in QuickTime "operation stopped the operation is not supported for this media" most times when I try and export an .AVI file as something else (e.g. .m4v). I have not touched the file in any way (no trimming, clipping or other editing), all I want QuickTime to do is export the file in a compressed format. Bizzarely, if I shutdown and open QuickTime many times I can occasionally export a clip as another format (maybe one in 10 times). I have seen that other users have had a similar problem after clipping files in QuickTime but this seems to be a slightly different bug in that all I do is open the file and then try and export the file as is - either way, this is a very annoying bug

    @Z_B-B, thank you for taking the time to respond to my cry for help. However, the link you supplied does not address the problem: I am not trying to export from Final Cut Pro to QuickTime, I am trying to export from QuickTime to the rest of the world (like people's iPhones and Ipads) in .m4v format (so I am not emailing my freinds such huge files).
    If I were to spend hundreds of Dollars on a copy of Final Pro I could export directly from there and not have to bother with QuickTime, but I do not take enough video clips to justify the cost. I must say that I never had any of these problems before I decided to switch from Snow Leopard to Mountai Lion.

  • Sales Order VA01 - "No control data for checking group 04 and checking rule

    Dear Gurus,
    When saving a sales order in VA01, I get the following message: "No control data for checking group 04 and checking rule A"
    Can anyone explain to me what that means?
    How can I correct this error?
    Regards
    Chris

    Check this thread
    [Re: Process Order Material availability check error|Re: Process Order Material availability check error;
    thanks
    G. Lakshmipathi

  • No control data maintained for checking group ZI and checking rule A

    Dear all,
                   When i do the availability check in the sales order i got the message as  No control data maintained for checking group ZI and checking rule A and finally availability check was not carried out, I check all the configuration under the sd-availabilitycheck and i maintained in material master also..........
    Please give me the solution
    Best Regards ,
    Kumar

    Hi,
    Did u maintain the scope of availability check like incluke reqts,planned reqts, purchase requisitions, production order, sales reqts,delivery reqts etc.
    apart from that you have to put check(Tick) mark in Requirment class and scheduleline categorie
    Then u have to maintain in material master individual requirmentss or daily requirments
    checking rule like A,B or if its consignment AW if it is returnable packaging AV etc(ImgS&D-Basicfunctions-Availabiltycheck&Tor---availability check aginst ATP)
    Then Total summarized daily reqts or summarized individual requts
    Plz check above all setting then u will get clear idea.
    Regards,
    Murthy

  • How to restrict users from printing documents and exporting to local file

    Hi SAP gurus,
    I have two questions.
    1. How can I restrict users from printing a document? i.e. billdoc? I would like to know if I could block it though authorization. If yes, what auth obj to use?
    2. How to restrict certain users from exporting to local file? the System> List>Save-->Local File. I have tried restricting it using auth object S_GUI but it seems it is only applicable to older versions of SAP. im on ecc6.
    Thank you in advance.

    Hi,
    Check this:
    Create your own gui status and attach it to the list in the event START-OF-SELECTION.
    In the menu painter extra -> adjust template.
    Make it a list status and you will see all the standard list options appear including list->download
    Deactivate the ones you don't want. 
    If you just want to prevent users from downloading the list you can achieve this with authorization object S_GUI, activity 61. Menu option will still be there though.
    Please note that if you remove authorisation for S_GUI activity 61 then all downloads will not be possible. 
    If you just want to disable downloads only for a particular report, you can try this test program:
    Code:
    REPORT ztest. 
      DATA: PROGNAME LIKE SY-CPROG value 'Z_CHECK_AUTH', 
            FORMNAME LIKE SY-XFORM value 'F_CHECK_AUTH'.
    START-OF-SELECTION. 
        CALL FUNCTION 'SET_DOWNLOAD_AUTHORITY' 
             EXPORTING 
                  FORM    = FORMNAME 
                  PROG    = PROGNAME 
             EXCEPTIONS 
                  OTHERS  = 1.
      WRITE: / 'TEST'.
    You also need this:
    Code:
    PROGRAM z_check_auth.
    FORM f_check_auth USING pe_result TYPE i. 
      pe_result = 5. 
    ENDFORM.
    Also have a look at the exit SGRPDL00.
    Hope this helps you.
    Rgds,
    Raghu

  • How to create LDAP filter-based rule to check Group membership in OAM

    Hi folks,
    I'm having hard time creating an authorization rule to verify ldap group membership. I've followed "Configure User Authorization" article from Oracle website (http://download.oracle.com/docs/cd/E10761_01/doc/oam.1014/b32420/v2authz.htm#BABHBFEJI) and created an Authorization scheme w ldap_attribute_name as User Parameter and ruleExpression as Required Parameter. Then, inside my policy I created an Authorization Rule based on my Authz scheme w Allow Access attrib filter-based Rule which looks like this:
    ldap://ldap_server:port/ou=People,o=Company,c=US??sub?(ldap_attribute_name=ldap_attribute_value)
    This works fine.
    Now, I've added another filter-based rule under the same Authz Rule/Allow Access:
    ldap://ldap_server:port/ou=Groups,o=Company,c=US?uniqueMember?sub?(&(objectClass=groupOfUniqueNames)(cn=ldap_group_name))
    While query looks somewhat correct and works as a command-line argument (slightly modified format), it does not work in OAM (meaning people w out req-d group membership can still login).
    Can someone steer me to the right direction as to what do I need to do:
    1. Change/fix the ldap query
    2. Create new Authz scheme with uniqueMember userParameter; create new Authz rule based on new authz scheme; create new Allow Access filter rule with the ldap query I have
    3. Do smth else
    Any help is greatly appreciated.
    Thank you, Roman

    You can create two authorization rules
    First for user with attribute
    and second for group
    and then in authorization expression you can have AND of these two.
    Regarding your query...
    First ... If your requirement is to give access to all the members of a particular group then you don't require any ldap filters
    All you have to do is in the authorization rule -> Allow access -> Select People (here you have to select group so click on the group tab, its little hard to see but its there in light blue color on dark blue tab) -> select the group you want to give access
    Second.. If your requirement is such that you want to give access to a member of a group which has certain attribute lets say group with status active ( In this case you are not aware of the name of the group because user can be a member of any group but you want to give access only to the group with specific attribute.) then you have to write custom authorization plugin.
    If the option is second let me know i can give you a solution which will work for a single domain without any effort of developing a major plugin.
    Hope this helps,
    Sagar

  • Import and export of word files with references (iPAD)

    Hi,
    Does Pages for iPAD supports importing and exporting of files with references generated by the prog "ENDNOTE" (http://www.endnote.com/). it s a must for grants and papers writing.
    is their any way to ask the apple guys directly (new to the apple world...)
    Thanks,

    obsidan wrote:
    Hi,
    Does Pages for iPAD supports importing and exporting of files with references generated by the prog "ENDNOTE" (http://www.endnote.com/). it s a must for grants and papers writing.
    Pages for iPad does not support export/import of Endnote references in the form of formatted bibliography.
    is their any way to ask the apple guys directly (new to the apple world...)
    Yes, indeed, feedback directly to Apple is possible
    http://www.apple.com/feedback/ipad.html
    While Pages does not currently import/export and preserve the Endnote formatted bibliography, another app known as Documents to go does; there is not citation software for adding references though, but preservation is good.

  • Silence added to the end of 1 of 2 songs that were "split" and exported as .aif files.

    Hey folks,
    I have 2 songs that run seamlessly (ideally) together. When splitting them apart in garageband and exporting them seperately as .aif files, I find that the first song ends up with about 4 seconds of silence at the end, while the other does not. This obviously affects their ability to run smoothly together in playback. I've tried doing this a couple different times but have only had luck when sending the songs directly to iTunes as a compressed file. Any ideas?
    Thanks

    infantalia11 wrote:
     song ends up with about 4 seconds of silence at the end
    http://www.bulletsandbones.com/GB/GBFAQ.html#exportexactlength
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • Import from dsv files and export to csv files

    hi every body..
    how can I create a project in NetBeans which does:
    1- import a .dsv (Delimiter-Separated Values) file content and save it to array
    - the values in this format separated by fixed commas
    example
    "AIG" "Insurance" "64.91" "25/11/06"
    2- export into .csv file (Comma Separated Value)
    -the values in this format separated by commas
    example:
    AIG,Insurance,64.91,25/11/06

    Well, you need to learn Java so you can read files, divide the data by the delimiters, and then write it out as a csv file.
    Can't really give better instructions than that...maybe start by reading the basic tutorials?
    We don't give out full program code here so you'll need to ask more precise questions. Such as what is it that you're having problems with.

  • New! Import and Export Form Design Files

    You can now export your form design to a Design File . You or other users can import the Design file and create a new form file from it.
    Use Cases / Benefits
    You can share your designs as templates for others to easily re-use
    You can create corporate branded form templates that can be used by your company's employees
    You can archive your form designs locally for later use
    How It Works
    To export a design file open a form file, go to the Design tab and select “Export Design File…” from File menu. The file extension of the exported Design File will be ".FCDT" - FormsCentral Design Template.
    To import a design file go to the “My Forms” dashboard and select “Import Design File…” from File menu. Select the desired .FCDT file.
    NOTE: The FCDT file contains the form Design only – it does not contain options, responses or summary reports.
    This feature is availabe to free and paid users of FormsCentral.
    Please send us your feedback on this feature. Enjoy!

    Hi
    It states that you can save your design and open it "This feature is availabe to free and paid users of FormsCentral" but it is greyed out on the free version. Will not let me import design I created. I had issues with the first design and tried to redesign and ended up with more issues that combined the first design with the second design.
    Can someone assist me with this, please,
    Thank you for your time and consideration,
    L.McD

  • Crop and export as tiff file

    I could not find my answer anywhere here. I cropped a group of files using 4 x 6 setting. Then exported as tiff files. I expected the files to be 4 x6 but they were not. The exported files were the cropped area as expected but the file size is approx 8 x 12.
    I would think if you exported cropped pictures the output would be the cropped size.
    What am I missing?
    Thanks for any help or suggestions.

    That what LR has is Aspect Ratios not crop size. To define a size with the crop ratio fill in the Constrain Pixel size dimensions in the Export Dialogue.
    Don
    Don Ricklin, MacBook 1.83Ghz Duo 2 Core running 10.4.9 & Win XP, Pentax *ist D
    http://donricklin.blogspot.com/

  • How do you save changes made in iPhoto, and export the changed file.  It keeps reverting back to the original.

    How do you save changes made in iPhote, and export the changed picture file? When I select export, current format, it reverts to the original, wiping out all my work.

    Try trash the com.apple.iPhoto.plist file from the HD/Users/ Your Name / library / preferences folder.
    (On 10.7 or later: Hold the option (or alt) key while clicking on the Go menu in Finder to access the User Library)
    (Remember you'll need to reset your User options afterwards. These include minor settings like the window colour and so on. Note: If you've moved your library you'll need to point iPhoto at it again.)
    What's the plist file?
    For new users: Every application on your Mac has an accompanying plist file. It records certain User choices. For instance, in your favourite Word Processor it remembers your choice of Default Font, on your Web Browser is remembers things like your choice of Home Page. It even recalls what windows you had open last if your app allows you to pick up from where you left off last. The iPhoto plist file remembers things like the location of the Library, your choice of background colour, whether you are running a Referenced or Managed Library, what preferences you have for autosplitting events and so on. Trashing the plist file forces the app to generate a new one on the next launch, and this restores things to the Factory Defaults. Hence, if you've changed any of these things you'll need to reset them. If you haven't, then no bother. Trashing the plist file is Mac troubleshooting 101.

  • How to merge adjustment layers to several layers and export layers to files

    Hi!
    I have now exactly the same problem as below with over 1000 images, I have saved them in .psd that has over 100 layers each. On top of those there is curves and levels layer that affects every layer below. I want to save all images to .jpg for videoedit with those curves at least. I don't want to merge same curves 100 times. Is there a solution in phothoshop cs5 or cs6 available? Would save alot of working hours. All I have got by this far is blank white images of adjustment layers and non adjusted jpg-files.
    This discussion was opened in 2010 and I quess this is same problem:
    How to merge adjustment layers to hundreds of layers?
    Jul 28, 2010 10:38 AM
    Say I have a photoshop File with 100 layers.  And say I created 3 adjustment layers on top of those 100 layers to get the adjustments that i want for those layers.   I'm happy with the adjustments but Then I NEED to merge those 3 adjustment layers to ALL those 100 layers.   Is there a way to easily permanently apply the adjustments to each of those layers without having to do it manually?     I absolutely need to merge the adjustments to the seperate layers because of how the layers are being used in a seperate 3d program.   
    So far what I've been doing is duplicating the adjustment layers for each layer and merging them to said layers separately.. Anyone have a better way? I wish I could just right click the adjustment layer and Tell it to merge to everylayer it affects  or apply to every layer underneath it!
    Anyone?
    Thanks!
    Thanks alot if u solve this!
    -Anne

    first
    doing action on one photo only with any effects or filtters .
    second
    doing Droplet  = File > Automate > Create Droplet.
    for more details with pictures here
    http://www.absba.org/showthread.php?t=1172143

  • Check the settings for checking group 02 and checking rule BO

    Hi,
    I am doing Backorder processing for order , I am getting the error as follows,
    I have checked Checking Rule For Updating Backorders. Everything ok.
    Please suggest.
    Thanks,
    Pramod

    One Probable reason for you error.
    Check the TC: OVZ2 whether you have ticked the Block qty req. for the Checking group 02 or you have selected No checks.
    The standard setting for 02 should not have any tick..
    or _Check in the TC : se38 program : SAPLOPP3.
    Check whether you have defined the plants with the checking rule BO.
    This must be your error._
    reward points if helpful,
    regards,
    Amlan Sarkar

Maybe you are looking for

  • Transaction type -Asset accounting

    Hello SAPians, User is reporting a problem relating to the write-up posting. Please check the details: User is using Transaction:ABZU(write-up) on Financial asset. In thisscenario  he is using 700 as transaction type and trying to simulate,but he is

  • G4 can't connect to Airport

    Yesterday, I installed Airport E, and I can now connect both a MacBook and an iMac G5 to the internet. The G4, which is not wireless had been (until yesterday) the only computer that could connect and get online. I know that I should be able to run a

  • Cannot install windows 7 on brand new mac mini with 256 g sdd? Please help.

    Cannot install windows 7 on brand new mac mini with 256 g sdd? Please help. Have tried all tricks found on the net and followed every advice from apple support. Still black screen with blinking curser when mini is rebooting following partitioning via

  • How to download a table of data to the FPGA

    I m using an PCI7813R FPGA board and  I'm trying to download a table of data into the FPGA.  How can I do this as fast as possible and so I can easily index each data row in the fpga.  The length of the table can be variable from run to run.  A block

  • Easier option for invoking external webservice

    Hi, what is the easy way to test invoking a nonSAP webservice (to which we give request and expect response). i did file to soap scenario using bpm, and i used file to soap using adapter module. but both are bit lengthy procedure to check if we can i