Home All Groups Group Topic Archive Search About

How do I deistinguis between a user and a group/role

Author
24 Mar 2006 5:26 PM
AdrianDams
I have an application in which I would like to add user accounts into an
object. The user gets to type in the user they want added. I only want to do
this for user accounts and not roles/groups. I am looking in
security.Principal but cannot find a way of doing this.

Is it possible?

Adrian

Author
24 Mar 2006 6:04 PM
Henning Krause [MVP]
Hello Adrian,

the only way I know to do this is to p/invoke LookupAccountSID to get the
type of a security identifier.

Greetings,
Henning Krause

Show quoteHide quote
"AdrianDams" <adriand***@yahoo.com> wrote in message
news:uElSpg2TGHA.4492@TK2MSFTNGP09.phx.gbl...
>I have an application in which I would like to add user accounts into an
> object. The user gets to type in the user they want added. I only want to
> do
> this for user accounts and not roles/groups. I am looking in
> security.Principal but cannot find a way of doing this.
>
> Is it possible?
>
> Adrian
>
Author
24 Mar 2006 6:09 PM
AdrianDams
Thanks Henning

Is LookupAccountSID a method in one of the security namespace objects?

Adrian
Show quoteHide quote
"Henning Krause [MVP]" <newsgroups.rem***@this.infinitec.de> wrote in
message news:eQlqi12TGHA.776@TK2MSFTNGP09.phx.gbl...
> Hello Adrian,
>
> the only way I know to do this is to p/invoke LookupAccountSID to get the
> type of a security identifier.
>
> Greetings,
> Henning Krause
>
> "AdrianDams" <adriand***@yahoo.com> wrote in message
> news:uElSpg2TGHA.4492@TK2MSFTNGP09.phx.gbl...
>>I have an application in which I would like to add user accounts into an
>> object. The user gets to type in the user they want added. I only want to
>> do
>> this for user accounts and not roles/groups. I am looking in
>> security.Principal but cannot find a way of doing this.
>>
>> Is it possible?
>>
>> Adrian
>>
>
>
Author
24 Mar 2006 6:27 PM
Dominick Baier [DevelopMentor]
it is a Win32 API.

Look in the Windows SDK:

ms-help://MS.MSSDK.1033/MS.WinSDK.1033/secauthz/security/lookupaccountsid.htm


---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

Show quoteHide quote
> Thanks Henning
>
> Is LookupAccountSID a method in one of the security namespace objects?
>
> Adrian
> "Henning Krause [MVP]" <newsgroups.rem***@this.infinitec.de> wrote in
> message news:eQlqi12TGHA.776@TK2MSFTNGP09.phx.gbl...
>> Hello Adrian,
>>
>> the only way I know to do this is to p/invoke LookupAccountSID to get
>> the type of a security identifier.
>>
>> Greetings,
>> Henning Krause
>> "AdrianDams" <adriand***@yahoo.com> wrote in message
>> news:uElSpg2TGHA.4492@TK2MSFTNGP09.phx.gbl...
>>
>>> I have an application in which I would like to add user accounts
>>> into an
>>> object. The user gets to type in the user they want added. I only
>>> want to
>>> do
>>> this for user accounts and not roles/groups. I am looking in
>>> security.Principal but cannot find a way of doing this.
>>> Is it possible?
>>>
>>> Adrian
>>>