I have created a custom user creation template that obviously creates the user in both on-prem and O365 as well as some custom attributes necessary in our environment. In addition to these custom attributes there is a script that I would like run after the user is created. This script has the sole purpose of enabling the user account with Multi-Factor Authentication.
In tests, while running the same exact script from power shell the script performs all actions as intended without delay and without error. While creating user accounts there is no error after account creation or in the logs but the effects of the script are not applied/script does not run.
the custom script field is:
I have tried different entries this is just the latest form I have tried.
The script is hard coded with the service account credentials that ADManager uses when it runs and creates accounts. It currently uses a hashed password file to pass the password. I have also configured it to use a plain text password as part of testing. Again, both of these versions of the script itself work fine when being run via powershell.
For the past 3 weeks support has not been able to provide any real answers to this and have been driven in circles. I have provided logs 3 separate times and have always had to initiate contact with support rather then them reach back out to me with updates on the issue.
This issue is similar to this thread
does ANYONE have any insight that may be useful? I can provide a scrubbed version of the script if needed for troubleshooting purposes if needed.