473,325 Members | 2,480 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,325 software developers and data experts.

SID lookup .NET 2.0

Is there an easy way in VB.NET 2.0 to lookup a SID when given a username? If
so could you provide an example. Thanks...
Jun 23 '06 #1
2 5566
If you find a way, please post it, I'm interested in this also -- primarily
it would help me quickly determine path to my installed apps that used the
MSI installs. As a worky solution I just load the entire subkey entries and
cycle thru them to find what I'm looking for -- pretty quick since there are
rarely more than 100 entries (certainly faster than trying to locate a file
on all local and/or removeable drives) for our typical client PCs.

"Nick" <nt********@online.nospam> wrote in message
news:08**********************************@microsof t.com...
Is there an easy way in VB.NET 2.0 to lookup a SID when given a username?
If
so could you provide an example. Thanks...

Jun 23 '06 #2
Thus wrote Nick,
Is there an easy way in VB.NET 2.0 to lookup a SID when given a
username? If so could you provide an example. Thanks...


Well, there's a super easy way in the *.NET Framework* 2.0 ;-)

This sample uses C#, but the important stuff is easy to pick up:

string userName = @"foo\joe";
NTAccount account = new NTAccount(userName);
SecurityIdentifier sid = (SecurityIdentifier) account.Translate(typeof(SecurityIdentifier));

Both NTAccount and SecurityIdentifier belong to the System.Security.Principal
namespace.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Jun 24 '06 #3

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

Similar topics

1
by: Srini | last post by:
I was reading the "Exceptional C++" of Herb Sutter. In an example, he mentions the following. // In some library header: namespace N { class C{}; } int operator+(int i, N::C) { return i+1; }...
2
by: CoreyWhite | last post by:
The future of computer architecture will use lookup tables. Currently computer processor speed outweighs the benefits of using computer memory for lookup tables, except in some cases. As computer...
8
by: Lucas Lemmens | last post by:
Dear pythonians, I've been reading/thinking about the famous function call speedup trick where you use a function in the local context to represent a "remoter" function to speed up the 'function...
9
by: Koen | last post by:
Hi all, My application uses a lot of lookup tables. I've splitted the frontend (forms, reports, etc) from the backend (data). The database has around 10 different users. The values in the...
3
by: my-wings | last post by:
I've been reading about how evil Lookup fields in tables are, but I've got to be missing something really basic. I know this subject has been covered before, because I've just spent an hour or two...
1
by: Zachary Turner | last post by:
I want to make a Lookup Field based on another Lookup field. In other words, I have this table A with two fields: ID and Name, where ID is an Autonumber and Name is a friendly name. Then I have a...
3
by: google | last post by:
I have a database with four table. In one of the tables, I use about five lookup fields to get populate their dropdown list. I have read that lookup fields are really bad and may cause problems...
13
by: paul.joseph.davis | last post by:
Hi, I've just had my first encounter with two-phase lookup and I'm scratching my head a bit. The idea behind two phase look up is pretty easy to understand, but I have a case that fails to...
11
by: ianoble | last post by:
I've been trying to piece together various code snippets to create a lookup table inside my xslt without the need for a supplemental xml file. Here is what I have so far. As of now, it does not...
1
by: joeino | last post by:
I want to do a lookup query and append the record to a history table before editing the data. I created a macro to run the lookup query to append the record to history and it works fine. I did the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.