473,385 Members | 1,372 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,385 software developers and data experts.

LookupAccountName does not seem to work correctly....

Hi,
I am trying to get the user account information using the function
LookupAccountName supplying it the user name. This API return the user SID if
the user exists.
Now, each SID has a user SID_NAME_USE which indicates the type of the user
e.g. SidTypeUser, SidTypeDomain, SidTypeComputer etc.

If I try this function for a normal user, it returns me the SID with correct
SID_NAME_USE as SidTypeUser.
However if I try this function for a computer account, this function returns
me the SID but with an incorrect SID_NAME_USE as SidTypeUser instead of the
expected SidTypeComputer.

Is it the expected behaviour? Am I missing something? Or should I use
another API which could give me correct user account type?

I would be highly grateful if anybody could help me in this regards.
Thanks,
Tushar

Nov 21 '05 #1
4 1870
Tushar,

I don't know what you are looking for, however getting the most simple way
the username in Net is environment.username.

There are more methods by the way without using an API.

Cor
Nov 21 '05 #2
Thanks a lot for the reply Cor - much appreciated.
I basically want to identify the user account type on a domain controller
given the account name and its RID. The account then can be of a normal user
or of a computer in that domain etc.
I looked into Net API's, however I am not currently using Net API library
and using those will require me to include the Net API library only for using
a single function. Is there any other way than using Net APIs? Also any
comment on the odd(?) behavior of the LookupAccountName API?

Thanks again,
Tushar.
"Cor Ligthert" wrote:
Tushar,

I don't know what you are looking for, however getting the most simple way
the username in Net is environment.username.

There are more methods by the way without using an API.

Cor

Nov 21 '05 #3
Tushar

The Ldap is probably what you are looking for, there is a lot information in
this newsgroup, and otherwise the newsgroup. dotnet.general here the search
in this newsgroup for ldap

http://groups-beta.google.com/group/...rch+this+group

I hope this helps,

Cor
Nov 21 '05 #4
Thanks for this Cor :)

"Cor Ligthert" wrote:
Tushar

The Ldap is probably what you are looking for, there is a lot information in
this newsgroup, and otherwise the newsgroup. dotnet.general here the search
in this newsgroup for ldap

http://groups-beta.google.com/group/...rch+this+group

I hope this helps,

Cor

Nov 21 '05 #5

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

Similar topics

12
by: Fred Pacquier | last post by:
First off, sorry for this message-in-a-bottle-like post... I haven't been able to phrase my questions well enough to get a meaningful answer from Google in my research. OTOH, it is standard...
11
by: Saqib Ali | last post by:
Please excuse me, this is a fairly involved question that will likely require you to save the file below to a file and open it in a browser. I use Mozilla 1.5, so the problem I describe below...
5
by: me | last post by:
I have a Class Library that contains a Form and several helper classes. A thread gets created that performs processing of data behind the scenes and the Form never gets displayed (it is for debug...
6
by: Tony | last post by:
I can't seem to get the session_end event to work? I've tried to update databases in it and response.redirect to someplace else. Nothing works. I load page and leave it for 60 minutes and I know...
1
by: Tim T. | last post by:
I've been scouring the internet for a simple example of the LookupAccountName function to retrieve a user's SID. All of the ones that I have found are complex and confusing. All I need is the...
6
by: Tomas Nilsson | last post by:
Working code below (paying back to the groups :) /Tomas Class SidFunctions Enum SID_NAME_USE SidTypeUser = 1 SidTypeGroup
6
by: Matt Kowalczyk | last post by:
Hello, Can someone explain to me why the following code works correctly? It would seem like it shouldn't. irc_client.c contains: #include "ircclient.h IRCClient* init_irc_client() {
48
by: Nathan Sokalski | last post by:
Ever since I found out that they didn't give us a way to install both IE6 and IE7 on the same machine, I have been more frustrated and annoyed with Microsoft than I ever have been with any company...
162
by: Sh4wn | last post by:
Hi, first, python is one of my fav languages, and i'll definitely keep developing with it. But, there's 1 one thing what I -really- miss: data hiding. I know member vars are private when you...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.