can convert SID to group name ?

  • Thread starter Thread starter Isky
  • Start date Start date
I

Isky

Hello,
i have the problem to convert the sid i get with the following code in
the name of the group..
I need to get for example "group_test" and not "S-1-5-32-544"
The code i use is
---
Dim irc As IdentityReferenceCollection
Dim ir As IdentityReference
irc = Principal.WindowsIdentity.GetCurrent.Groups
For Each ir In irc
Response.Write(ir.Value)
Next
 
The SID identifies the group. You can use it to query your identity
repository (most likely Active Directory) to get the friendly name. I would
google search this one.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***********************************************
Think Outside the Box!
***********************************************
 
Isky,
You need to use IdentityReference.Translate to convert the
SecurityIdentifiers that WindowsIdentiy.Groups returns into NTAccounts

Something like:
Dim irc As IdentityReferenceCollection
Dim ir As IdentityReference
irc = WindowsIdentity.GetCurrent().Groups
For Each ir In irc
Dim account As IdentityReference =
ir.Translate(GetType(NTAccount))
Debug.WriteLine(account.Value)
Next



--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


| Hello,
| i have the problem to convert the sid i get with the following code in
| the name of the group..
| I need to get for example "group_test" and not "S-1-5-32-544"
| The code i use is
| ---
| Dim irc As IdentityReferenceCollection
| Dim ir As IdentityReference
| irc = Principal.WindowsIdentity.GetCurrent.Groups
| For Each ir In irc
| Response.Write(ir.Value)
| Next
|
|
| ---
| thanks and sorry for my english :)
|
 
Back
Top