Retrieves the name of the account for a SID
#include <Security.au3>
_Security__LookupAccountSid ( $vSID [, $sSystem = ""] )
$vSID | Either a binary SID or a string SID |
$sSystem | [optional] The name of a remote computer. By default the local system. |
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. |
_Security__GetAccountSid, _Security__LookupAccountName
Search LookupAccountSid in MSDN Library.
#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