Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Not sure if Powershell is capable of doing this, but this is what I need...

$
0
0

Trying to figure out if Powershell is capable of:

  1. Selecting a selection of security groups from a list
  2. Using this list to add a group of computers pulled from active directory to those groups

This is what I have so far:

  1. Pulls computer names from .csv to prestage accounts in hardcoded OU
  2. creates listbox of security group names pulled from domain
  3. (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"...

Viewing all articles
Browse latest Browse all 15370

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>