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

Active Directory SID problem

107 100+
Im trying to return the SID for all users in our active directory

The problem is that they all return the same!

Our active directory runs in a Windows 2000 native functional level, would this affect it?

I can get any other details from it just not the SID.

the value returned is obviously in binary, and displays as some strange character on the page, and its the same character for every user. I then convert the binary to plain text using the following function:


Expand|Select|Wrap|Line Numbers
  1.  
  2. // Converts a little-endian hex-number to one, that 'hexdec' can convert
  3. function littleEndian($hex) {
  4.     for ($x=strlen($hex)-2; $x >= 0; $x=$x-2) {
  5.         $result .= substr($hex,$x,2);
  6.     }
  7.     return $result;
  8. }
  9.  
  10. // Returns the textual SID
  11. function binSIDtoText($binsid) {
  12.  
  13.     $hex_sid=bin2hex($binsid);
  14.     $rev = hexdec(substr($hex_sid,0,2));    
  15.     $subcount = hexdec(substr($hex_sid,2,2)); 
  16.     $auth = hexdec(substr($hex_sid,4,12));  
  17.     $result = "$rev-$auth";
  18.     for ($x=0;$x < $subcount; $x++) {
  19.         $subauth[$x] = hexdec($this->littleEndian(substr($hex_sid,16+($x*8),8)));  
  20.         $result .= "-".$subauth[$x];
  21.     }
  22.  
  23.     return $result;
  24. }
  25.  
They all get returned from this as "1-0-0-0-0-0-0"

I dont think the conversion function is the problem here as all the SID's look the same before!


Can anyone help!?!?!


thanks


Andy
Jul 31 '08 #1
1 2230
theS70RM
107 100+
on reflection,m maybe i should be using the objectguid rather than objectsid. Im using it as a unique identifier in a database to expand on the information already stored in the active directory.

From what I've just read the GUID will remain constant throughout the life of the object, but the SID can change if the object is moved to a different domain for example.

Anyone got any input on this??


Cheers
Jul 31 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Mario Rodriguez | last post by:
Hi people. I have a problem adding users to Win2003 active directory programatically. When I execute my app throws the following exception: .................The specified directory service...
10
by: huzz | last post by:
I have web application that quaries the Active Directory to get user details.. everything works fine but someday I'll get System.Runtime.InteropServices.COMExection and if I restart the client...
1
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem...
9
by: Patrick | last post by:
I have an ASP.NET page that searches for someone in the corporate Active Directory. It had been working fine until recently when I changed from Basic Authentication on IIS6 back to Integrated...
1
by: tangus via DotNetMonster.com | last post by:
Hello all, I'm really struggling with getting some Active Directory code to work in ASP.NET. Can you please provide assistance? I am executing the following code: Dim enTry As DirectoryEntry =...
4
by: pjdouillard | last post by:
Hello all, Here is the context of my problem: We have an ASP.NET 1.1 application that has its own application pool setup and that runs under the identity of a NT Domain service account (this...
0
by: RTT | last post by:
here is my current situation. I develop a program on my computer's localhost. From there i contact Active directory succesfull using a connectionstring like:...
0
by: Kooki | last post by:
Hi, I am developing a small programme to add ACTIVE DIRECTORY users to another server. everything works fine .. I get the users from AD using LDAP but while adding users I need to get the user...
3
by: Lucky | last post by:
Hi guys, after long long time. i'm back again with another problem. this time i think the problem is very very interesting and i really need you help on this. i'm trying to connect to the...
2
by: Jim in Arizona | last post by:
My goal, somehow, is to populate a dropdownlist with all the user names in active directory. I don't even know where to begin, really. I added a reference to System.DirectoryServices so I could...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
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...

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.