Get group Name

Hi all !
I developp an application with labview 2009. Different user can use this application. Each user may have specific rights depending on the group he belongs to. e.g. admin, operateur....
To do this, i created severeal group in Windows XP, and severeal user in each group. In my application i want to retrieve the user ans the group of the user which is logged in. I found how to retrieve the user name, but i can't find anything to get the group he belongs to... i read severeal post in the forum and it seems to be impossible to do ....
Any idea how to do this ??? Thanks for your future answer....

I would search the registry, if the information is stored there. Look under the key CURRENT_USER.
Felix 
www.aescusoft.de
My latest community nugget on producer/consumer design
My current blog: A journey through uml

Similar Messages

  • Not able to get group name by using memberof class, getting Total groups as 0 even I am member of that group.

    Not able to get group name by using memberof class, getting Total groups as 0 even I am member of that group. Through this memberof class I am trying to find full qualified name(DN) of my group.
    code I have used:
    //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(CN=Username))";
                   //Specify the Base for the search
                   String searchBase = "";
    Also I have used,
                 String searchFilter = "(&(objectClass=user)(CN=Username))";
                   //Specify the Base for the search
                   String searchBase = "ou=ibmgroups,o=ibm.com";
    But in both cases I am getting value for Total groups as 0.
    Code Reference:
    * memberof.java
    * December 2004
    * Sample JNDI application to determine what groups a user belongs to
    import java.util.Hashtable;
    import javax.naming.*;
    import javax.naming.ldap.*;
    import javax.naming.directory.*;
    public class memberof     {
         public static void main (String[] args)     {
              Hashtable env = new Hashtable();
              String adminName = "CN=Administrator,CN=Users,DC=ANTIPODES,DC=COM";
              String adminPassword = "XXXXXXX";
              String ldapURL = "ldap://mydc.antipodes.com:389";
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              //set security credentials, note using simple cleartext authentication
              env.put(Context.SECURITY_AUTHENTICATION,"simple");
              env.put(Context.SECURITY_PRINCIPAL,adminName);
              env.put(Context.SECURITY_CREDENTIALS,adminPassword);
              //connect to my domain controller
              env.put(Context.PROVIDER_URL,ldapURL);
              try {
                   //Create the initial directory context
                   LdapContext ctx = new InitialLdapContext(env,null);
                   //Create the search controls          
                   SearchControls searchCtls = new SearchControls();
                   //Specify the search scope
                   searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
                   //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(CN=Andrew Anderson))";
                   //Specify the Base for the search
                   String searchBase = "DC=antipodes,DC=com";
                   //initialize counter to total the group members
                   int totalResults = 0;
                   //Specify the attributes to return
                   String returnedAtts[]={"memberOf"};
                   searchCtls.setReturningAttributes(returnedAtts);
                   //Search for objects using the filter
                   NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);
                   //Loop through the search results
                   while (answer.hasMoreElements()) {
                        SearchResult sr = (SearchResult)answer.next();
                        System.out.println(">>>" + sr.getName());
                        //Print out the groups
                        Attributes attrs = sr.getAttributes();
                        if (attrs != null) {
                             try {
                                  for (NamingEnumeration ae = attrs.getAll();ae.hasMore();) {
                                       Attribute attr = (Attribute)ae.next();
                                       System.out.println("Attribute: " + attr.getID());
                                       for (NamingEnumeration e = attr.getAll();e.hasMore();totalResults++) {
                                            System.out.println(" " +  totalResults + ". " +  e.next());
                             catch (NamingException e)     {
                                  System.err.println("Problem listing membership: " + e);
                   System.out.println("Total groups: " + totalResults);
                   ctx.close();
              catch (NamingException e) {
                   System.err.println("Problem searching directory: " + e);
    Any help will be highly appreciated.

    Not able to get group name by using memberof class, getting Total groups as 0 even I am member of that group. Through this memberof class I am trying to find full qualified name(DN) of my group.
    code I have used:
    //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(CN=Username))";
                   //Specify the Base for the search
                   String searchBase = "";
    Also I have used,
                 String searchFilter = "(&(objectClass=user)(CN=Username))";
                   //Specify the Base for the search
                   String searchBase = "ou=ibmgroups,o=ibm.com";
    But in both cases I am getting value for Total groups as 0.
    Code Reference:
    * memberof.java
    * December 2004
    * Sample JNDI application to determine what groups a user belongs to
    import java.util.Hashtable;
    import javax.naming.*;
    import javax.naming.ldap.*;
    import javax.naming.directory.*;
    public class memberof     {
         public static void main (String[] args)     {
              Hashtable env = new Hashtable();
              String adminName = "CN=Administrator,CN=Users,DC=ANTIPODES,DC=COM";
              String adminPassword = "XXXXXXX";
              String ldapURL = "ldap://mydc.antipodes.com:389";
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              //set security credentials, note using simple cleartext authentication
              env.put(Context.SECURITY_AUTHENTICATION,"simple");
              env.put(Context.SECURITY_PRINCIPAL,adminName);
              env.put(Context.SECURITY_CREDENTIALS,adminPassword);
              //connect to my domain controller
              env.put(Context.PROVIDER_URL,ldapURL);
              try {
                   //Create the initial directory context
                   LdapContext ctx = new InitialLdapContext(env,null);
                   //Create the search controls          
                   SearchControls searchCtls = new SearchControls();
                   //Specify the search scope
                   searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
                   //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(CN=Andrew Anderson))";
                   //Specify the Base for the search
                   String searchBase = "DC=antipodes,DC=com";
                   //initialize counter to total the group members
                   int totalResults = 0;
                   //Specify the attributes to return
                   String returnedAtts[]={"memberOf"};
                   searchCtls.setReturningAttributes(returnedAtts);
                   //Search for objects using the filter
                   NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);
                   //Loop through the search results
                   while (answer.hasMoreElements()) {
                        SearchResult sr = (SearchResult)answer.next();
                        System.out.println(">>>" + sr.getName());
                        //Print out the groups
                        Attributes attrs = sr.getAttributes();
                        if (attrs != null) {
                             try {
                                  for (NamingEnumeration ae = attrs.getAll();ae.hasMore();) {
                                       Attribute attr = (Attribute)ae.next();
                                       System.out.println("Attribute: " + attr.getID());
                                       for (NamingEnumeration e = attr.getAll();e.hasMore();totalResults++) {
                                            System.out.println(" " +  totalResults + ". " +  e.next());
                             catch (NamingException e)     {
                                  System.err.println("Problem listing membership: " + e);
                   System.out.println("Total groups: " + totalResults);
                   ctx.close();
              catch (NamingException e) {
                   System.err.println("Problem searching directory: " + e);
    Any help will be highly appreciated.

  • When I enter a group name into the Bcc field and try to send the message, I get "[group name] is not a valid e-mail address..."

    Been using the same template to send a weekly newsletter for a year or two but now with a recent update to Thunderbird the group name is rejected when I try to send the message:
    With a group name in Bcc field, when I press "Send" and try to send the message, I get this alert: "[group name] is not a valid e-mail address because it is not of the form user@host. You must correct it before sending the e-mail."

    This has been reported as [https://bugzilla.mozilla.org/show_bug.cgi?id=1060901 Bug #1060901]. If you have an account on Bugzilla, please consider voting for that issue.
    Several other people have sent in the same support request as you, noting this happened after they upgraded to version 31.1.
    The exact error message is: XXXX is not a valid e-mail address because it is not of the form user@host. You must correct it before sending the e-mail.
    '''This happens in Thunderbird 31.1.0 when your mailing list description includes several words separated by spaces.'''
    Although not ideal, these workarounds should let you use your mailing lists until a proper fix is implemented:
    * While composing an email open the address book and select the list you are trying to send to, highlight all the names in the list and drag them to the To: box. This uses your existing data without modifying it.
    * Replacing the blanks " " between the words in such lists' descriptions with an underscore "_". This requires modifying your mailing list(s) description(s).
    * Downgrade to a previous version and disable automatic updates (Windows)

  • Hot to get group name in obiee 11g

    Hi All,
    We have a requirement that whenever user login in answers, based on his group he should be able to see only his department data.If some how captures the group name we can filter the data by assisgning the group name to the variable but we stuck up with getting the group name.Please help us

    VALUEOF(NQ_SESSION.GROUP) shud give u the value of GROUP
    http://108obiee.blogspot.in/2009/10/referencing-group-session-variable-in.html
    http://gerardnico.com/wiki/dat/obiee/system_session_variable
    Pls mark answered if it solves the issue.

  • Getting group names for a list of IDs

    I've got the list of group IDs of which the user is a member, and I'm trying to get the group names in a single query. I've got it working where I get each name in a loop, but I'm concerned about performance if a user is a member of a large number of groups.
    This is the Java code I've been fooling with:
    Object qFilter[][] = new Object[3][1];Integer ids[] = new Integer[iGroupIDs.length];for (i = 0; i < iGroupIDs.length; i++) { ids[i] = (Integer)iGroupIDs; }
    qFilter[0][0] = new Integer(PT_PROPIDS.PT_PROPID_USERGROUP_GROUPID); qFilter[1][0] = new Integer(PT_FILTEROPS.PT_FILTEROP_IN);qFilter[2][0] = ids;ptQueryResult = objMgrGroups.Query(PT_PROPIDS.PT_PROPID_USERGROUP_SIMPLENAME, -1, PT_PROPIDS.PT_PROPID_USERGROUP_SIMPLENAME, 0,-1,qFilter);
    I keep getting an exception:
    Native exception: The parameter is incorrect. (0x80070057): [ParseQueryFilter error on clause #0
    (0x80070057) Invalid property ID specified (0x10000)] (612,PTDispatch.cpp)
    I'm new to PT programming so I'm a bit stumped as to what is the issue. Any hints anyone can offer is appreciated. Thanks!

    Thanks to everyone - responded.
    This is group set up when creating user. This is standard functionality.
    What we do:
    Step 1.
    Using "Administer" tab in portal, then using "Create new groups" link, We have created various groups. We assigned six digit numeric value to group name. We have several groups, such as 001234, 002235, 003348. These group's have different privilege.
    Step 2.
    Using "Administer" tab, we create new user on a regular basis using "Create new users" link. Later on, we assign these new user to a group created in step 1.
    We have a custom table, where we store, user and their corresponding group information, such as:
    record user name group name date created
    1 aaa 001234 01-02-04
    2 bbb 001234 01-04-04
    3 ccc 002235 01-05-04
    Key in the table is based on both user and group name.
    What I need to find out is, when user 'aaa' logged in, to find out who is the user and what portal group this user belong to.
    Then join these two value to our custom table to make sure to match the user and his group name, and get other value from other table and display in the LOV.
    But I am not sure what API need to use in my query in LOV. Or is there any other way?
    Thanks

  • How to get Group Name of current Group Portal session?

    How do I obtain the Group Name associated with the Group Portal of the current user session?

    Michel,
    Thank you that worked. I have a follow up question that I am hoping you can answer.
    I am trying to build a drop menu for all the Portal Pages that appear in the nav
    bar. The drop down menu items should correspond to the users visible portlets for
    each Portal Page.
    The following code works if the ProfileIdentity is created for the Group, but does
    not return any results if the ProfileIdentity is created with the User.
    PagePersonalization pagePersonalization = portalPersonalization.getPagePersonalization(pageState.getPageIdentifier());
    if (pagePersonalization != null) {
         Iterator menuItr = pagePersonalization.getPortletPersonalizations();
         while (menuItr.hasNext()) {
              PortletPersonalization portletPersonalization = (PortletPersonalization)menuItr.next();
              String portletName = portletPersonalization.getDisplayName();
    Is there another way to obtain the information I am looking for?
    Thanks,
    Diana
    "Michel Bisson" <[email protected]> wrote:
    >
    Diana,
    You can retrieve the group name for the current session as follows:
    // Sample code... (disclaimer: not compiled!)
    import com.bea.portal.appflow.PortalAppflowFactory;
    import com.bea.portal.appflow.PortalSession;
    import com.bea.p13n,usermgmt.profile.ProfileIdentity;
    PortalSession portalSession = PortalAppflowFactory.createPortalSession(request,
    false);
    ProfileIdentity profileIdentity = portalSession.getIdentity();
    String groupName = profileIdentity.getGroupname();
    You can read the Javadoc online http://edocs.bea.com/wlp/docs40/javadoc/wlp/index.html
    for the classes used above.
    Hope this helps.
    Michel.
    "Diana" <[email protected]> wrote in message news:3ce1ac7c$[email protected]..
    How do I obtain the Group Name associated with the Group Portal of thecurrent user session?

  • Can't get Group name to be accepted in Mail

    I have  a group created in Contacts but Mail won't accept it or any other Group name in the To: line. When I hit Enter, the name just disappears. When I click on the plus sign at the right of the To: line, the Group names appear but when I double-click any of them, nothing happens. What am I doing wrong?

    As a work around until Apple fixes this, open Contacts, select the group, and control - click on it. It gives you an e-mail option.
    10.9.1 beta released

  • How to get tag group name?

    Hi experts,
    I am new in PCO Queries.
    I have requirement of fetching Tagname , Description and TagGroup name from OPC and  insert into Sybase db table.
    how can I write the PCO Query to fetch tag's  group name and tag description .
    Tagnames are configured as alias in agent instance instead of subscription items and entered manually with data type as float.
    I am assuming that Description and Group name should configure while adding tags in PCO as alias then write a PCO query and send to Sybase tables.
    Please help me to get group name and Description of tag which belongs to it.
    your earliest help would be highly appreciated.
    Thanks&Regards,
    Pooja.
    Message was edited by: pooja rani

    Hi Steve,
    Thanks for your reply.
    RSView 32 OPC server and PCO2.3 and MII server 14.0  we are using.
    Thanks&Regards,
    Pooja.

  • Get ABGroup name

    Hi
    I know very little about objective c but need this code to get the name of an address book group to use in an applescript I have written. I found a sample code that shows how to get a persons name and info and was trying to change it to get the selected groups name. I have inserted some alerts to help with debugging and I think the problem is with using 'recordForUniqueId' to get the group but cannot find another way to do it.
    Any suggestions?
    @implementation ABHandler
    + (NSDictionary *)getABDictFromID:(NSString *)theID
    NSString *firstName, *groupName = @"12";
    ABAddressBook *addressBook;
    addressBook = [ABAddressBook sharedAddressBook];
    ABGroup *group = (ABGroup *)[addressBook recordForUniqueId:theID];
    ABPerson *person = (ABPerson *)[addressBook recordForUniqueId:theID];
    if (group)
    NSRunAlertPanel (nil, groupName, nil,nil,nil);
    groupName = [group valueForProperty:kABGroupNameProperty];
    if (!groupName) groupName = @"";
    NSRunAlertPanel (nil, groupName, nil,nil,nil);
    if (person)
    firstName = [person valueForProperty:kABFirstNameProperty];
    if (!firstName) firstName = @"";
    NSRunAlertPanel (nil, firstName, nil,nil,nil);
    return [NSDictionary dictionaryWithObjectsAndKeys:
    groupName, @"groupName", firstName, @"firstName",
    nil];
    @end

    Not sure why you would even revert to ObjC code here - you can get group names directly with AppleScript. The problem however is that you can't really select a group in the Address Book - you always select a person - the result of
    tell application "Address Book" to get selection
    will always print out something like
    {person id "D5931944-8B2F-4A3F-8931-82677BAB60D0:ABPerson"}
    (note the "ABPerson" suffix). If the selected person is member of only one group, the following AppleScript will get that group's name:
    tell application "Address Book"
    set theGroups to groups of (item 1 of (get selection))
    if (count of theGroups) is 1 then set theGroupName to name of item 1 of theGroups
    end tell
    Andreas

  • LabVIEW 8.0:: How to get the group name of a user logged to a NI Security Domain?

    Hello all,
    I am using LabVIEW 8.0 PDS.
    I created a new local domain called "MyDomain" in the "NI Domain Account Manager" . I added a new User called "MyUser" and a new group called "Maintenance". I set "MyUser" to be a member of the "Maintenance" group. Then, I configured LabVIEW to invoke the login dialog at start-up in order to log "MyUser" with the correct password.
    I would like to get the group name of the current user logged programmatically in a VI. I tried with the VI Server >> Application >> Security properties and methods and also with the properties and methods of the NI Security Class but it seems to be not so simple as I believed at start.
    I do not find any informations or KB on this (all the documents I found deal with LV DSC or TestStand).
     The final goal is to be able to manage a list of user for my application. Each user is a member of a group ("Administrator", "Operator", "Maintenance") and depending on the group, the user can or cannot access to some parts of the application.
    Thanks for your help.
    Matthieu
    Eurilogic

    Re,
    Here is a screenshot of this functions...
    If you really own LV DSC 8.2 the best thing to do is to reinstall it.
    Regards, 
    Message Edité par Richard K. le 04-02-2007 04:00 AM
    Richard Keromen
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> Découvrez, en vidéo, les innovations technologiques réalisées en éco-conception
    Attachments:
    security.jpg ‏3841 KB

  • Getting only name of the physical disk from cluster group

    hi experts,
    i want to know the name of my cluster disk example - `Cluster Disk 2` available in a cluster group. Can i write a command something like below.
    Get-ClusterGroup –Name FileServer1 | Get-ClusterResource   where  ResourceType is Physical Disk
    Thanks
    Sid
    sid

    thanks Chaib... its working.
    However i tried this
    Get-ClusterGroup
    ClusterDemoRole
    | Get-ClusterResource
    | fl name
    |  findstr
    "physical Disk"
    which is also working.
    sid

  • How do I get rid of group names

    How do I get rid  of group names in contacts, I seem to have loads of group names ??

    Those are not users. They're computers or printers on the network. Your Wi-Fi network may be insecure. Check the router settings to make sure you're using WPA 2 security, and if you are, change the password to a random string of at least ten upper- and lower-case letters and digits. Any password that you can remember is not good enough.

  • FI-SL: create an user exit to get the "name of the group account"

    Hi,
    I'm creating a special ledger and have to add 2 informations:
    - name of the general account
    - name of the group account
    The table I se is ACCIT_GLX. In this table, I can't get the name of the general and group accounts directly.
    I guess I have to use user exits.
    I can find the name of the general account in the table SKA1. But do you know where I can find the name of the group account?
    I'm not a developer at all. But I just need the name of the field and table to indicate them to the IT team.

    Dear Expert,
    In Tcode Fs00 when you create GL account Master there is Group Account number when you maintain group chart of accounts this field automatically becomes mandatory entry , here Press F1 and Select the Technical Details button there you can find the Technical name and the table and other details of it.
    Regards,
    Shankar K B

  • [TIP]-Getting Uses Group Names Efficiently

    We were having trouble getting the names of the groups that a user belonged to. We could easily get the object ID's but getting the name for each group was very slow issuing single row queries. Anyway we are able to query group memberships efficiently using a queryfilter.
    Here is a code snippet in Java:
    public ArrayList getUserGroupNames ()
    throws MalformedURLException, RemoteException, NotInRequestException
    ArrayList groupNames = new ArrayList();
    IRemoteSession remoteSession = edk.getRemotePortalSession();
    //Get array of group object Id's that the user belongs too.
    int[] groupIdArray = remoteSession.getUserManager().getCurrentUserGroups();
    //Issue a query on the object Id's to get their names
    ObjectProperty[] op = {UserGroupProperty.SimpleName};
    QueryFilter[] qf = {new IntArrayQueryFilter(ObjectProperty.ObjectID, Operator.In, groupIdArray)};
    IObjectQuery ioq = remoteSession.getUserGroupManager().queryObjects(-1, 0, -1, ObjectProperty.ObjectID, true, op, qf);
    for (int i = 0; i < ioq.getRowCount(); i++)
    groupNames.add(ioq.getRow(i).getStringValue(UserGroupProperty.SimpleName));
    return groupNames;
    Hope this is usefull to others.

    Hi,
    You can still add 50 addresses to the group in the paid version and test it without sending it. After adding all contacts to the group, click on the group name and it should launch the Mail application with all recipient's email addresses populated in the respective To, CC or BCC fields. You can touch the CC or BCC fields and it will expand the list containing all the addresses.
    Since you dont wan't to send the email, you can just cancel out of the operation after verifying if all the email addresses are being populated.

  • Get the groups name of a user in openldap authenticator

    Hi,
    I am using an openldap for user authentification. How can i retreive the groups name of a user ? I read that i must use the GroupManagerControl class.
    What is the way to specify the openldap authenticator using the above class ?
    Thanks for help.

    If you are referring to a user's group membership in the Active Directory, then indeed JNDI & LDAP can be used to retrieve these values.
    If you are referring to a user's local groups on their own workstation, then you may want to investigate either the JNDI NTLM provider or perhaps the Samba JCIFS stuff.

Maybe you are looking for

  • Can't connect my P1102w printer to my wireless network (using Mac OS 10.6)

    I have a vanilla home wireless network (D-Link to a cable modem), and a MacMini running OS 10.6.8. My Mac laptop and 4th. Gen iPad work seamlessly. But my hours-long attempt to connect my new HP P1102w to the network has been totally frustrating, des

  • How to stop form increments?

    Im using Dreamweaver 8 and having major problems with the way that it automatically increments . from the help page: quote: Naming a form makes it possible to reference or control the form with a scripting language, such as JavaScript or VBScript. If

  • My kid forget id and password to use i pod touch now we can not do anything help

    i have a ipod touch my kid forget pascode and id and now is locked we can not do anythingcon not get in go on line help how do i ghange the passcode on this thing

  • CRM - BW Reporting

    Hi Experts Please advise how do we extract data from CRM. As R/3 steps are different from CRM side. We do not have LBWE and LBWG BW Reportgin requirement. Raj

  • Recover Files - DFS Deleted

    Hi, Someone in our office ran an incorrect robocopy command which ended up in alot of information being deleted from a DFS. The changes were made on the source folder which was not up to date with the destination folder so I assume all our missing fi