Solved

Convert Hex SID to Dec SID

Posted on 2004-04-27
2
2,083 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
2 Comments
 
LVL 41

Expert Comment

by:graye
Comment Utility
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 82

Accepted Solution

by:
oBdA earned 125 total points
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

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…
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now