473,403 Members | 2,183 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

can convert SID to group name ?

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 :)

Dec 1 '05 #1
2 16990
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" <is****@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
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 :)

Dec 1 '05 #2
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
"Isky" <is****@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
| 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 :)
|
Dec 2 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Markus Hämmerli | last post by:
I ' ll tra to convert a Cstring to char* without success. I working in a Unicode enabled environment this is working in Unicode CString source = _T("TestString"); TCHAR *szSource =...
12
by: Guy | last post by:
I got a big Access file (1 400 tables) to convert to SQL and I would like to be provided with some automated tools, except upsizing wizard and DTS, to convert it on my own. I got a lot of forms...
3
by: ambersaria420 | last post by:
Hi All, I need to help with converting rows to columns in SQL2k. Input: Id Name Role 58 Ron Doe Associate 58 Mark Bonas Doctor 59 Mike Johnson Doctor
5
by: Carl Gilbert | last post by:
Hi I have some ASP code that I want to run from CD within a VB.NET windows application with a web browser control. However, to get the ASP pages to run without a server is proving quite...
12
by: dixie | last post by:
Can someone familiar with Access 2003 please answer this question? I am asking because I don't have the use of A2003. When Access 2003 finds an Access 2000 database, does it come up with some...
2
by: Alberto | last post by:
why there isn't a Convert.ToFloat() method in the Convert class? Sometimes I can't work with a float field because there isn't this method and I need it to, for example, convert the input in a...
0
by: Isky | last post by:
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...
2
by: kirke | last post by:
Hi, I have a datetime column named dtDateTime. its format is "Oct 27 2006 12:00:00 " I want to group by only date part of it and count my code is $sql1="SELECT ...
1
by: Mushq | last post by:
Hi, I want to convert following VB6 code to C#, can some one help me regarding that. // Code starts here strComputer = "atl-ws-01" Set objGroup = GetObject("WinNT://" & strComputer & "/...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.