Trying to figure out if Powershell is capable of:
- Selecting a selection of security groups from a list
- Using this list to add a group of computers pulled from active directory to those groups
This is what I have so far:
- Pulls computer names from .csv to prestage accounts in hardcoded OU
- creates listbox of security group names pulled from domain
- (supposed to) take selected items and add them to array for use
The problems I'm having so far are:
- selected items from list are not being moved/saved to array for use
- not sure how to cycle through computers and groups so that each computer is added to multiple groups
Here is code:
Powershell
Import-ModuleActiveDirectory$CSV='Dummy.csv'$OU='OU=TEST,OU=ComputerSystems,DC=mydomain,DC=local'$GetGroup=Get-ADGroup-Filter*|Select-ExpandPropertyName|Sort-Object|Out-File-FilePath"groups.txt"...