# Import credentials from AdminCredential.xml $cred = Import-Clixml -Path "AdminCredential.xml" # Start a new PowerShell process with the credentials # THIS WORKS DO NOT DELETE # Start-Process -FilePath "PowerShell_ISE.exe" -ArgumentList "-File Organizational_Unit_Editor\OUUSerAuditEdit.ps1" -Credential $cred # Start-Process -FilePath "PowerShell_ISE.exe" -ArgumentList "-File Organizational_Unit_Editor\OUUSerAuditEdit.ps1" -Credential $cred # Start-Process "powershell.exe" "-File OUUSerAuditEdit.ps1" -Credential $cred *> Output.log # BELOW WILL NOT RUN WITH ADMIN RIGHTS # powershell.exe -NoExit -NoProfile -ExecutionPolicy Bypass -File Organizational_Unit_Editor\OUUserAuditEdit.ps1 -Verbose -Credential $cred *> Output.log Start-Process powershell.exe -Credential $cred -ArgumentList "-File Organizational_Unit_Editor\OUUSerAuditEdit.ps1" -NoNewWindow -Wait