Function Reference


_Security__IsValidSid

Validates a SID

#include <Security.au3>
_Security__IsValidSid ( $pSID )

Parameters

$pSID Pointer to a SID

Return Value

True: the SID is valid.
False: the SID is not valid.

Related

_Security__GetLengthSid

See Also

Search IsValidSid in MSDN Library.

Example

#include <Security.au3>

Local $tSID = _Security__GetAccountSid(@ComputerName)
If Not @error Then
        ; $tSID is structure filled with SID data for spesified account
        ; Check this SID for validity:
        Local $bValid = _Security__IsValidSid($tSID)
        If $bValid Then
                ConsoleWrite("The SID is valid." & @CRLF)
                ; ... The rest of the script here...
        Else
                ConsoleWrite("The SID is NOT valid." & @CRLF)
                Exit
        EndIf
EndIf