Bind to the object using the LDAP:// or the WINNT:// provider and output to screen as below, pipe it or write it where needed.
Can’t claim this as my own – source is Richard Mueller,
<SNIP> Option Explicit Dim strSid, objUser
Set objUser = GetObject("LDAP://cn=TestUser,ou=Sales,dc=MyDomain,dc=com") strSid = OctetToHexStr(objUser.objectSid)
Wscript.Echo HexStrToSidStr(strSid)
Function HexStrToSidStr(strSid) Dim arrbytSid, lngTemp, j
ReDim arrbytSid(Len(strSid)/2 - 1) For j = 0 To UBound(arrbytSid) arrbytSid(j) = CInt("&H" & Mid(strSid, 2*j + 1, 2)) Next
HexStrToSidStr = "S-" & arrbytSid(0) & "-" _ & arrbytSid(1) & "-" & arrbytSid(8)
lngTemp = arrbytSid(15) lngTemp = lngTemp * 256 + arrbytSid(14) lngTemp = lngTemp * 256 + arrbytSid(13) lngTemp = lngTemp * 256 + arrbytSid(12)
HexStrToSidStr = HexStrToSidStr & "-" & CStr(lngTemp)
lngTemp = arrbytSid(19) lngTemp = lngTemp * 256 + arrbytSid(18) lngTemp = lngTemp * 256 + arrbytSid(17) lngTemp = lngTemp * 256 + arrbytSid(16)
HexStrToSidStr = HexStrToSidStr & "-" & CStr(lngTemp)
lngTemp = arrbytSid(23) lngTemp = lngTemp * 256 + arrbytSid(22) lngTemp = lngTemp * 256 + arrbytSid(21) lngTemp = lngTemp * 256 + arrbytSid(20)
HexStrToSidStr = HexStrToSidStr & "-" & CStr(lngTemp)
lngTemp = arrbytSid(25) lngTemp = lngTemp * 256 + arrbytSid(24)
HexStrToSidStr = HexStrToSidStr & "-" & CStr(lngTemp)
End Function
Function OctetToHexStr(arrbytOctet) ' Function to convert OctetString (byte array) to Hex string.
Dim k OctetToHexStr = "" For k = 1 To Lenb(arrbytOctet) OctetToHexStr = OctetToHexStr _ & Right("0" & Hex(Ascb(Midb(arrbytOctet, k, 1))), 2) Next End Function
<SNIP>
-----Original Message-----
LDP wont work for NT it uses LDAP API.
CM
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Salandra, Justin A. The LDP.exe should do it for the AD side of the house, not sure about the NT side
-----Original Message-----
In the middle of a migration from NT4 to AD and am looking for a tool that will display the SIDs (NT and AD) of migrated users. We are using the NET IQ product for the user/computer migration. Thanks in advance |
Title: Looking for a tool that displays SID
- RE: [ActiveDir] Looking for a tool that displays ... Salandra, Justin A.
- RE: [ActiveDir] Looking for a tool that displays ... Kitchens Arthur E
- RE: [ActiveDir] Looking for a tool that disp... Justin_Leney
- RE: [ActiveDir] Looking for a tool that disp... joe
- Re: [ActiveDir] Looking for a tool that ... Brent Westmoreland
- [ActiveDir] Really goofy DNS trouble Malachi Burke
- RE: [ActiveDir] Looking for a tool that displays ... Anderson Santos Patricio
- RE: [ActiveDir] Looking for a tool that displays ... Burns, Clyde
- RE: [ActiveDir] Looking for a tool that displays ... Carlos Magalhaes
- RE: [ActiveDir] Looking for a tool that disp... Nicolas Blank
- RE: [ActiveDir] Looking for a tool that disp... Luiz Carlos do Lago