Active Directory ConnectorAfterCreate Rule and Using Mutex for Logging

I am using a “ConnectorAfterCreate” Rule on our Active Directory Source to facilitate the provisioning of user accounts.

I recently made an update to this rule to include the use of Mutex in the Powershell code.

The use of Mutex should help us with issues were seeing when writing output to a log file. Currently, when too many users are loaded at once we see contention errors on the log file we’re using for the Powershell.

Example Powershell Code:
$mtx = New-Object System.Threading.Mutex($false, “LogMutex”)

When trying to upload the update for the new code for the “ConnectorAfterCreate” Rule, which includes the Mutex, I am seeing the following error:

“Illegal value "[{"line":13,"column":30,"message":"Remove reference to Thread"}]" for field "sourceCode.script".”

This line and column number lines up with the “System.Threading” Powershell Object in the code.

Does this mean I can’t use the “System.Threading” Object in Powershell for a “ConnectorAfterCreate” Rule for Active Directory? The error seems to imply that I cannot access that object to make use of the Mutex.