Extracts the domain and user account name from a fully qualified user name.
#Include <WinAPIEx.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. |
失败: | 返回 0 并设置 @error 标志为非 0 值, @extended 标志可能包含一个系统错误代码. |
在MSDN中搜索
#Include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
Global $Data = _WinAPI_ParseUserName('ALX\Alexander')
ConsoleWrite('Domain: ' & $Data[0] & @CR)
ConsoleWrite('User: ' & $Data[1] & @CR)