Search the Community
Showing results for tags 'laps'.
Found 1 result
Has anyone had success managing LAPS with AutoIT? (LAPS is Microsoft's Local Admin Password Solution.) I am running v126.96.36.199 and Powershell 5.1.17134.858 on Windows 10 1803 build 17134.885. I have read the entire AutoIT Help file, all of the AD UDF scripts and supporting HTML files, and a large part of the Internet and have researched myself into paralysis. My company has more than one domain with two-way trusts and use LAPS on each domain. At present, we remote in to a jump box in each domain when we need to manage a device there. I want to build a multiple-domain console that works just like the LAPS UI, but allows the user to select a domain via pull-down. At this point, I can't even get the crazy thing to work on the current domain. If I feed it $sComputername = 'T4211BLC1' $sComputerName = GUICtrlRead($idComputerName) $iPID = Run('powershell.exe -executionpolicy bypass Get-AdmPwdPassword "' & $sComputerName & '"', "c:\", @SW_Show, $STDOUT_CHILD) ; Wait until the process has closed using the PID returned by Run. ProcessWaitClose($iPID) ; Read the Stdout stream of the PID returned by Run. While 1 $sOutput = StdoutRead($iPID) if @error then ExitLoop if $sOutput <> "" Then $sStdout = $sStdout & @CRLF & $sOutput WEnd sends this to the console: Get-AdmPwdPassword : The term 'Get-AdmPwdPassword' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + Get-AdmPwdPassword T4211BLC1 + ~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Get-AdmPwdPassword:String) , CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException But if I put this on the Windows command line: powershell.exe -executionpolicy bypass Get-AdmPwdPassword "T4211BLC1" ...it runs perfectly. ComputerName DistinguishedName Password Expiration Timestamp ------------ ----------------- -------- ---------- T4211BLC1 CN=T4211BLC1,OU=GPO Computers Testing OU,O... YQc7Cl39wFrIF5 6/10/20... So (if you're still awake), Why can't Powershell find 'Get-AdmPwdPassword' when called from within AutoIT? Why can't I read STDOUT? FYI - I've tried ShellExecute, and calling a .ps1 from the script, even Run('cmd /k ...) and I get the same result - Powershell doesn't recognize the cmdlet. Thanks in advance!!