Powershell -ExecutionPolicy Unrestricted
C:\ManageEngine\scripts\testname.ps1 %username%
Testname.ps1 (powershell script)
param($user)
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command ". 'C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto "
Set-User -Identity $user -RemotePowerShellEnabled $false
But it seems to be not working. I get "Custom script result: Custom script is running in the background." but it never works.
In the logs I can see the script ran picking up the username but I can't tell if the username is being applied inside the script. I spent 2 hours with support and they keep asking me for the same information over and over again. Not getting anywhere with this.