Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Trying to run simple AD Group Creation script

$
0
0

trying to run:

c:\create ad groups> runas</g> /u:domain\administrator "powershell -file c:\create ad groups\cgps.ps1"

I get prompted and enter correct password

Result:

Attempting to start powershell -file c:\create ad groups\cgps.ps1 as user "ikobram\administrator" ...

No Joy

Simply trying to run cgps.ps1 to create 4 AD groups

cgps.ps1 looks like:

Import-Module ActiveDirectory
$groups = Import-Csv ‘c:\spgroups.csv‘
foreach ($group in $groups) {
New-ADGroup -Name $group.name -Path “OU=SharePoint,OU=Security Groups,OU=Global,OU=IKOGroup,DC=NA,DC=IKO” -GroupCategory Security -GroupScope Universal
}

Yes the .csv file is properly formatted and available.



Viewing all articles
Browse latest Browse all 15028

Latest Images

Trending Articles



Latest Images

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