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.