Re: Get Windows Group Name

From: Joe Kaplan \(MVP - ADSI\) (joseph.e.kaplan_at_removethis.accenture.com)
Date: 07/01/05


Date: Fri, 1 Jul 2005 08:57:19 -0500

Can you p/invoke the LookupAccountName API, passing in the SID of the group
you want to use? Everyone and Authenticated Users are both well-known SID
values that don't change, so that might be a good way to get the localized
version.

It is too bad that the .NET MQ API won't take a SID directly as then you
would not have this problem.

Joe K.

"Simon Niederberger" <simon@sincore.ch> wrote in message
news:ecrHLBYfFHA.3904@TK2MSFTNGP14.phx.gbl...
> Hi
>
> I need to create a MessageQueue in my C# service (running as SYSTEM).
> Users
> will have no permissions on this queue, so I can't look if messages are
> present. When setting MessageQueue.SetPermissions, I have the problem of
> knowing the Windows Group Name. I'd like to set Full Control to either
> Users
> or Everyone (doesn't really matter), but the service might run under
> English
> (Users, Everyone) or German Windows (Benutzer, Jeder). On a German
> Windows,
> SetPermissions failes with "Everyone" and succeeds with "Jeder".
> How can I get the locale-specific name of a role, say "Users"?
>
> Or is there a much easier way to set Full Control Permissions on a
> MessageQueue for Everyone?
>
> Thanks a lot
> Simon
>
>



Relevant Pages

  • Re: get logged in domain name
    ... > I currently use LookupAccountName to get the domain nameof the user ... > Public Function GetLogonDomainuser(sUserName As String) As String ... ' This will contain your SID. ... > ' of the current user account, call the LookupAccountName API ...
    (microsoft.public.vb.winapi)
  • Re: get logged in domain name
    ... I just found an issue if there is a local account ... >> Public Function GetLogonDomainuser(sUserName As String) As String ... >> ' of the current user account, call the LookupAccountName API ... The first time is to get the required sizes of the SID ...
    (microsoft.public.vb.winapi)
  • Re: Security ID
    ... Does anyone know how i can get the SID of the current user. ... what format do you want the SID in? ... The LookupAccountName API call can be used ... think it *might* be necessary since there's an API function to get it. ...
    (microsoft.public.vb.general.discussion)