Function Reference


_WinAPI_ParseUserName

Extracts the domain and user account name from a fully qualified user name

#include <WinAPIShPath.au3>
_WinAPI_ParseUserName ( $sUser )

Parameters

$sUser The user name to be parsed. The name must be in UPN or down-level format, or a certificate.

Return Value

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.

See Also

Search CredUIParseUserName in MSDN Library.

Example

#include <WinAPIShPath.au3>

Local $aData = _WinAPI_ParseUserName('ALX\Alexander')

ConsoleWrite('Domain: ' & $aData[0] & @CRLF)
ConsoleWrite('User:   ' & $aData[1] & @CRLF)