I've got a working PHP script that changes Active Directory passwords. The one problem I have is that I can't pass a password with a & in it because it breaks the powershell command. Is there a good way to escape that?
Here is what I'm running:
Here is what I'm running:
Code:
$adpwchange = shell_exec("powershell import-module activedirectory ; Set-ADAccountPassword -identity $login -reset -newpassword (convertto-securestring -asplaintext '$password' -force) < NUL");