$ComputerName = "THAPAKORN02" $Password = "" If $ComputerName <> "" Then $PSCommand = "Get-AdmPwdPassword -ComputerName " & $ComputerName $Output = Run(@ComSpec & ' /c powershell.exe -Command "' & $PSCommand & '"', "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While 1 $Line = StdoutRead($Output) If @error Then ExitLoop If StringInStr($Line, "Password") Then $Password = StringRegExpReplace($Line, ".*: (.+)", "$1") EndIf WEnd EndIf ConsoleWrite($ComputerNam&" : "&$Password&@CRLF)