|
|
|
| 15 June 2002 | GetADsPathFromHexSid() |
| Author | Howard A. Bullock |
| Action | Uses COM (ADsSecurity.DLL) to translate a Hex Sid into the objects AdsPath. |
| Syntax | GetADsPathFromHexSid ($HexSid) |
| Parameters | |
| Remarks | This UDF was designed to work with StrSidToHexSid() and PadStr(). When used with those two UDFs, standard string sids as found in HKEY_USERS can be can be converted to a named security object such as a user. |
| Returns | String: WinNT://DomainName/ObjectName |
| Dependencies | ADsSecurity.DLL |
| Examples |
GetAdsPathFromHexSid("010500000000000515000000CC557001034DBD3D8EE8E65B79050000")
|
| Source |
FUNCTION GetADsPathFromHexSid ($hexsid)
DIM $oadssid
$getadspathfromhexsid = ""
$oadssid = CreateObject("ADsSid")
IF VarTypeName($oadssid) = 'Object'
$oadssid.setas(1,$hexsid)
IF @error <> 0
? "Failed: SetAS(1,$HexSid) @Error @Serror"
EXIT 1
ENDIF
$getadspathfromhexsid=$oadssid.getas(5)
IF @error <> 0
? "Failed: GetAS(5) @Error @Serror"
EXIT 1
ENDIF
ELSE
? "CreateObject('ADsSid') Failed. @Error @Serror"
? "AdsSecurity.DLL required."
EXIT 1
ENDIF
EXIT 0
ENDFUNCTION ; - GetADsPathFromHexSid -
|
|
|
|