scripting@wanadoo.nl




GetADsPathFromHexSid()

http://www.scriptlogic.com/kixtart/FunctionLibrary_FunctionList.aspx


actual FunctionLibrary list on 'Scriptlogic' site printer-friendly mirror of UDF topic on 'scripting@wanadoo.nl' site close
15 June 2002 GetADsPathFromHexSid()
AuthorHoward A. Bullock
Action Uses COM (ADsSecurity.DLL) to translate a Hex Sid into the objects AdsPath.
SyntaxGetADsPathFromHexSid ($HexSid) 
Parameters
  • $HexSid (Required / String) Valid sid in Hex format. 
  • RemarksThis 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. 
    ReturnsString: WinNT://DomainName/ObjectName 
    DependenciesADsSecurity.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 -
     
      original source of UDF topic. show actual FunctionLibrary list on Scriptlogic site close top
              printer-friendly mirror of UDF topic on scripting@wanadoo.nl site  




    Copyright © 2003 www.scriptlogic.com & scripting@wanadoo.nl - last updated on 20 May 2003


    Site Meter