Extracts the domain and user account name from a fully qualified user name
#include <WinAPIShPath.au3>
_WinAPI_ParseUserName ( $sUser )
$sUser | The user name to be parsed. The name must be in UPN or down-level format, or a certificate. |
Success: | The array containing the following information: [0] - The domain name (if present). [1] - The user account name. |
Failure: | Sets the @error flag to non-zero, @extended flag may contain the system error code. |
Search CredUIParseUserName in MSDN Library.
#include <WinAPIShPath.au3>
Local $aData = _WinAPI_ParseUserName('ALX\Alexander')
ConsoleWrite('Domain: ' & $aData[0] & @CRLF)
ConsoleWrite('User: ' & $aData[1] & @CRLF)