Function Reference


_Security__LookupAccountSid

Retrieves the name of the account for a SID

#include <Security.au3>
_Security__LookupAccountSid ( $vSID [, $sSystem = ""] )

Parameters

$vSID Either a binary SID or a string SID
$sSystem [optional] The name of a remote computer. By default the local system.

Return Value

Success: an array with the following format:
    $aAcct[0] - Account name
    $aAcct[1] - Domain name
    $aAcct[2] - SID type
Failure: sets the @error flag to non-zero.

Related

_Security__GetAccountSid, _Security__LookupAccountName

See Also

Search LookupAccountSid in MSDN Library.

Example

#include <Security.au3>
#include <SecurityConstants.au3>

Local $aArrayOfData = _Security__LookupAccountSid($SID_ALL_SERVICES)

; Print returned data if no error occured
If IsArray($aArrayOfData) Then
    ConsoleWrite("Account name = " & $aArrayOfData[0] & @CRLF)
    ConsoleWrite("Domain name = " & $aArrayOfData[1] & @CRLF)
    ConsoleWrite("SID type = " & _Security__SidTypeStr($aArrayOfData[2]) & @CRLF)
EndIf