Handling of Multiple Threads in PowerShell Script in Connector After Create Rule

Hi Team,

We have a Connector After Create Rule in which the PowerShell Script is embedded for creation of Exchange Mail box and Home Drive folder. When we are testing this rule for a single user, we are able to create both Exchange Mail box and Home Drive folder without any issues.
However, when we tried to implement the same for multiple users(at least 2), we see that the creation of Exchange Mail box and Home Drive folder is random.

When multiple threads of PowerShell Script are running, Our guess is that these threads are trying to update the same log file.
Later, we edited the PowerShell Script with separate log file for each saMAccountName in which case we are able to create Exchange Mail box and Home Drive folder for all users successfully.
However, the catch is that we are getting separate log file for user which will result in multiple log files.

Seek your inputs on resolving this.

Thanks,
Kartheek

Can you share the code lines where the log files are being updated?

We handle this issue using mutexes

3 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.