Hi all! I am very new to scripting and powershell in general. Unfortunatly I have a problem for a customer that I need to fix. I have to create 150 global security groups in AD and because Powershell is THE magic solution for every admin and we all have to learn it I definitly want to do it this way.
Ok so I created a csv file with the following parameter in Excel:
name ,parent,samaccountname,grouptype,groupscope,description SG_TEST1,"OU=Test,DC=apple,DC=local",SG_TEST1,security,global,Applicatiegroep Test1 SG_TEST2,"OU=Test,DC=apple,DC=local",SG_TEST2,security,global,Applicatiegroep Test2 SG_TEST3,"OU=Test,DC=apple,DC=local",SG_TEST3,security,global,Applicatiegroep Test3 SG_TEST4,"OU=Test,DC=apple,DC=local",SG_TEST4,security,global,Applicatiegroep Test4
I see know that Excel throws everything in one colum and different lines, I seperated the colums in Excel, but the csv does it this way. I hope thats ok. So the domainname is just a test domain and I am running this in a test environment. I installed the quest ActiveRoles AD PowerShell extensions and added them. When I type the following command in powershell or the powergui nothing happens. No errors, just enter and then a blinking cursor. The OU stays empty, no groups.
This is the script: import-csv c:\test.csv | foreach {New-QADGroup -Name $_name -ParentContainer $_parent -SamAccountName $_samaccountname -GroupType $_grouptype -GroupScope $_groupscope -Description $_description}
I tried also to do the $_.name, so with a dot but also not the solution. Dubugging mode in Powergui does nothing.
Also running powershell in administrator mode. C: drive security settings maybe?
Can somebody help me please!
Thanks in advance!
Jeroen
Message was edited by: Jeroen
|