Add user to Ad group

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2016 09:31 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2016 07:38 AM
Do you have multiple domains? What does that data in your array look like?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2016 08:05 AM
I am using this code for single user
Import-Module ActiveDirectory
$GrpName = "${workflow.scratchpad.GrpName}"
$DLMem = Get-ADUser -identity ${workflow.scratchpad.userSAM}
Get-AdGroup -identity $GrpName | Add-ADGroupMember -Members $DLMem -Confirm:$false -credential $cred
Now i need to add the users in array "user1, user2, user3,user4," to AD group.
how to loop them in Power shell.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2016 08:54 AM
I spoke with our powershell guru and he said he was able to do a direct powershell script like below but he do not have anything like this in our servicenow environment so I'm not sure how it would translate.
set-adobject "group"
-Add @{ member = @('user1','user2') }
note the @() for the array notation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2016 09:09 AM
Brian,
I think i have given wrong information. My actual requirement is:
There is a catalog request which a requester can give many user names (List Collector variable) and a group name in the Item. After all approvals
using orchestration i need to add those users to the group in AD.
I have made a string with all user names from the request separated by ",".
I need power Shell scripting to add those users to the group. Help me with the script.
Thanks
Shiva

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2016 10:10 AM
that is what I gave you.