Hello Everyone,
We are facing the issue in the production environment for few users during the execution of after create PowerShell scripts / native rules.
As per our findings, Active Directory After Create Rule is Throwing below error message and not able to execute the actual PowerShell script in the IQService Server. It looks like serviceResult is returning ‘&’ somehow and if ‘&’ character is there in result its throwing error.
Note: Its only failing with this error for few users only.
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double quotation marks (“&”) to pass it as part of a string.
You will have to to sanitize the input either by wrapping it in quotes '"&"' or by replacing & with an escaped version (‘`&’) in your script.
This ensures that (&) is treated as part of the string rather than as an operator.
Hope this helps!