Function Reference


Retrieves the security identifier (SID) for an account

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


$sAccount Specifies the account name.
Use a fully qualified string in the domain_name\user_name format to ensure that the function finds the account in the desired domain.
$sSystem [optional] Name of the system. This string can be the name of a remote computer.
If this string is blank, the account name translation begins on the local system.
If the name cannot be resolved on the local system, this function will try to resolve the name using domain controllers trusted by the local system.

Return Value

Success: a binary SID in a byte structure.
Failure: 0.




#include <Security.au3>

Local $tSID = _Security__GetAccountSid(@UserName)
If Not @error Then
    ; $tSID is structure filled with SID data for spesified account
    ; ... The rest of the script here...