Orchestration: Add User to Group Activity (Multiple Users and Multiple Groups) SUCCESS and WALK-THROUGH
Hey Folks,I'm back at it and trying to solve problems that i have encountered and i've seen on the community that many of you have experienced as well...
In OOB Orchestration for Active Directory, there is an activity to Add User to Group. And it works great. It does exactly what it's supposed to do. And it has it's uses. However, there is a serious need for the ability to add to multiple groups. Or the ability to add multiple user to a single group, or sometimes, even multiple users to multiple groups.
Wouldn't it be nice if you needed to add 10 users to 10 groups each, you could do that in one single activity, instead of 100 separate activities?
Stay tuned and keep reading for the ability.
Now for the Standard OOB Add User to Group.
1. It works well, but not quite good enough for what everyone wants.
2. If the user is already in the group, it will return a failure from the activity.
I understand that this is an activity, so if the user is already in the group, it will not perform an action and technically fails, but this is not ideal for holding up a workflow. If a user is already in the group, i'd like it if the workflow would continue without me having to look through it to see the user is already in the group. I know, i could write an if script to look for a "user already in group" failure code. But lets simplify this some. If a user is already in a group, and you try to add, then Success in my book, not action needed, but not a failure. It means i verified they were already in the group.
3. If you need to add a user to 15 groups, you either need to run 15 different workflows, or find a way for the add user to group to cycle back around via another script.
I would like to be able to send an array of groups and be done with it. I dont care if a user is already in the group or not. If a user is already in the group, great, move on to the next group.... Also, i would like to know which ones were added and which ones they were already a member of.
So i'm a ServiceNow Developer/Admin/Engineer or whatever else you want to call me. My expertise is not on the Active Directory side. and in turn is not on the Powershell side. So i was beating my head against a wall facing these issues.
Now my resolution was to create a new Activity.
FULL DISCLAIMER HERE:
My Setup for testing.....
This was all done and tested on Kingston, since London is having Mid Server issues right now when i tried this exact same thing on London, nothing would process through the ECC queue.
1. I have a VM running server 2008, acting as a DNS Server, DHCP Server and a AD Domain server. (self contained domain)
2. I have a VM running Windows 7 pro running as the machine holding my Mid Server service. (on the above domain)
3. My personal Developer site is straight OOB Kingston, only alterations/customization were done to create these activities and test them.
NONE OF THIS WAS DONE IN A CORPORATE ENVIRONMENT, SO MAKE SURE YOU TEST EVERYTHING THOROUGHLY BEFORE MOVING TO PRODUCTION.
CHECK WITH YOUR ACTIVE DIRECTORY TEAM TO MAKE SURE THESE ACTIONS ARE OK WITH THEM.
Since there are a lot of people, including myself, that seem to think the Docs for ServiceNow are not always the best at giving examples, those of you who are more technical, please forgive me, but i'm going to go through this for those developers/admins that are new to servicenow and go through this step by step. As this particular subject seems to be a very sore spot for a lot people, i want to make sure it's very clear on how to create this and how it's used.
Labels:
https://www.servicenow.com/community/now-platform-articles/orchestration-add-user-to-group-activity-multiple-users-and/ta-p/2314866
