Validates a SID
#include <Security.au3>
_Security__IsValidSid ( $pSID )
$pSID | Pointer to a SID |
True: | the SID is valid. |
False: | the SID is not valid. |
Search IsValidSid in MSDN Library.
#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