Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Adding Assets to AD groups

PVK1
Mega Sage

Hello Experts, 

I have a requirement to add Computers Assets to the AD groups, I wanted to know if they are any OOB Powershell scripts or PowershelModules's on Mid Server Script Files. Like [ActiveDirectory.psm1] to add Users to AD groups. 

Thanks

1 ACCEPTED SOLUTION

PVK1
Mega Sage

Hello Guys, 

Finally, I was able to finish it, by creating a new AddAssetToADgroup.psm1 file for adding Assets using the some of the existing code from OOB file ActiveDirectory.psm1. Then I went to the workflow editor, created a custom Activity designer "AddComputerToADGroups" added parameters as needed(check the below Image). It all worked out well. 

 

find_real_file.png

Thanks

View solution in original post

2 REPLIES 2

PVK1
Mega Sage

Hello Guys, 

Finally, I was able to finish it, by creating a new AddAssetToADgroup.psm1 file for adding Assets using the some of the existing code from OOB file ActiveDirectory.psm1. Then I went to the workflow editor, created a custom Activity designer "AddComputerToADGroups" added parameters as needed(check the below Image). It all worked out well. 

 

find_real_file.png

Thanks

Mouli8
Giga Contributor

Hi PVK,

 

what did you write in AddAssetToADgroup.psm1?

Also,this powershell add computer in multiple groups in AD?