Add user to Ad group

Brian Lancaster
Tera Sage

I have a requirement to add users to AD groups via ServiceNow Orchestration.   What is the best way to do this?   I thought it would be update AD object but i'm note sure what to put in Object data field.

18 REPLIES 18

I have gotten this working.   Your mid server service must be running under an AD account with these permission and then in service now under Orchestration > Credentials you need to put the windows credentials for this account.



Here is what my powerschell script looks like now.   The workflow.scratchpad variables are coming from a run script I have setup earlier in the workflow.


Powershell.png


That makes sense but does that mean I can ever only write to one AD? I am trying to test with a QA AD and will need to be able to do AD actions agains multiple Domain Controllers depending on the user/request.


We have multiple domains that all have a trust relationship.   My workflow scratchpad variables sending the distinguished name for both the group and the user account.


eg. CN=Jeff Smith,OU=Sales,DC=Fabrikam,DC=COM


That makes sense thanks Brian, I think I have what I need to set this up.


Brian,


I am in the same situation, I need to add users to group in AD.



My users are in a string var called "workflow.scratchpad.GrMem" separated with User by ",".



I need to add those users to group in AD.


Please help me with Power shell script.