Solved

Convert Hex SID to Dec SID

Posted on 2004-04-27
2
2,176 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 84

Accepted Solution

by:
oBdA earned 125 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

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…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

733 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