Combining scripts in provisioning policies

Is there any guidance on whether we should combine scripts in provisioning policies or have separate scripts for each task?

Whilst reviewing our scripts in our User Provisioning policy, I've found we have two scripts both using the same event handler (onPostModify).  One script checks the office and updates the address in the request, the other script checks for any linked accounts need to be updated (we have virtual attributes that link accounts).

Whilst I can like the fact each script is going is own job, I wonder if there is a performance hit for doing this?

Top Replies

  • Hi  

    To some extent this is personal choice, there are advantages and disadvantages to both approaches. IE:

    • Multiple executions of shorter quicker scripts, vs single execution of longer slightly…
Parents
  • Hi  

    To some extent this is personal choice, there are advantages and disadvantages to both approaches. IE:

    • Multiple executions of shorter quicker scripts, vs single execution of longer slightly more complex scripts. (Plus any overhead from executing a script, especially if loading modules without checking, or using Exit accidentally in PowerShell scripts)
    • Smaller more readable scripts, vs larger most difficult to read scripts.

    My usual approach is (where possible is) to combine as many of the tasks into a single script module (granted using Library Script where I can locate re-useable code), and ensure I have appropriate checks in my logic to prevent doing tasks that are not required. Only splitting into different scripts for different use cases.

    However it does depend on what your doing, as their might be other methods to deliver the same results (or not as the case may be).

Reply
  • Hi  

    To some extent this is personal choice, there are advantages and disadvantages to both approaches. IE:

    • Multiple executions of shorter quicker scripts, vs single execution of longer slightly more complex scripts. (Plus any overhead from executing a script, especially if loading modules without checking, or using Exit accidentally in PowerShell scripts)
    • Smaller more readable scripts, vs larger most difficult to read scripts.

    My usual approach is (where possible is) to combine as many of the tasks into a single script module (granted using Library Script where I can locate re-useable code), and ensure I have appropriate checks in my logic to prevent doing tasks that are not required. Only splitting into different scripts for different use cases.

    However it does depend on what your doing, as their might be other methods to deliver the same results (or not as the case may be).

Children