Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Convert Hex SID to Dec SID

Posted on 2004-04-27
2
Medium Priority
?
2,327 Views
Last Modified: 2012-05-04
I have a quick but relatively complex question
 
Environment - Native Mode, Win 2000 Active Directory.
 
I am looking for a method to convert an active directory HEX value of a User's SID into is Decimal value
 
For example a user account value in the registry can be displayed as S-1-5-21-1390067357-484763869-1801674531-3404 as it's Decimal value or 15 15 52 da be 9d 1c e4 e8 dd 6b 63 5f 23 d4 c as it's HEX Value.
 
What I would like to achieve is a way to convert between the 2, using script. That way I can setup a scrip to 1st Poll a resource to gain the HEX value of a SID and then resolve that to the DEC value so that I can compare it against another Resource.
 
If there is any function in either VBScript, WMI, WSH or ADSI that would be beneficial.
0
Comment
Question by:davidsummers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 41

Expert Comment

by:graye
ID: 10935341
I'd be difficult to represent the HEX version of a SID in a script in anything other than a string.   Where are you getting this SID from?

I'd be a rather simple task to write a small application that translated a string of hex values into a SID-formated string.  I'll write you one...
0
 
LVL 85

Accepted Solution

by:
oBdA earned 375 total points
ID: 10936876
Try those for starters:

Platform SDK: Security      -- SID Components
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/security/sid_components.asp

Platform SDK: Security      -- Converting a Binary SID to String Format in C++
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/security/converting_a_binary_sid_to_string_format_in_c__.asp

HOWTO: Use Microsoft Visual Basic to Convert a Raw SID into a String SID
http://support.microsoft.com/default.aspx?kbid=286182

HOWTO: Convert the SDDL form of an SID to a SAM Account Name
http://support.microsoft.com/default.aspx?kbid=276208

How do I convert a SID between binary and string forms?
http://blogs.msdn.com/oldnewthing/archive/2004/03/15/89753.aspx
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
What monsters are hiding in your child's room? In this article I will share with you a tech horror story that could happen to anyone, along with some tips on how you can prevent it from happening to you.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question