Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

How to create AD group in another domain

$
0
0

Hi Everyone, 

I have to create 600 AD local groups across the country for various domains. I am putting together a "*.csv" file with the below header, but unsure where to specify my credential "-Credential", and to specify the other domains "-Service" within the script shown below.

 

*.CSV Header:

name

 

 

parent

 

 

samaccountname

 

 

grouptype

 

 

groupscope

 

 

description

 

 

notes

 

 

Script:

import-csv c:\test.csv | foreach {New-QADGroup -Name $_.name -ParentContainer $_.parent -SamAccountName $_.samaccountname -GroupType $_.grouptype -GroupScope $_.groupscope -Description $_.description -Notes $_.notes}


Viewing all articles
Browse latest Browse all 6937

Trending Articles