Difference between revisions of "Quest powershell to create a batch of users"
From MyWiki
Line 6: | Line 6: | ||
## Some assorted notes below | ## Some assorted notes below | ||
+ | ## Creating an array | ||
$myArray = "Banana","Carrot","Pineapple","Cabbage","Turnip","Cauliflower","Beetroot","Celery","Potato","Mushroom","Onion" | $myArray = "Banana","Carrot","Pineapple","Cabbage","Turnip","Cauliflower","Beetroot","Celery","Potato","Mushroom","Onion" | ||
+ | |||
+ | ## Generating a random number | ||
Get-Random -minimum 1 -maximum 101 | Get-Random -minimum 1 -maximum 101 | ||
+ | |||
+ | ## Variations | ||
($a = "Dasher","Dancer","Prancer","Vixen","Comet","Cupid","Donder","Blitzen" ) | Get-Random | ($a = "Dasher","Dancer","Prancer","Vixen","Comet","Cupid","Donder","Blitzen" ) | Get-Random | ||
Get-Random -input "Dasher","Dancer","Prancer","Vixen","Comet","Cupid","Donder","Blitzen" | Get-Random -input "Dasher","Dancer","Prancer","Vixen","Comet","Cupid","Donder","Blitzen" |
Revision as of 16:39, 6 January 2015
New-QADUser -name 'psych001' -ParentContainer 'OU=Visitors_and_Guests,OU=Goldsmiths_Users,DC=campus,DC=goldsmiths,DC=ac,DC=uk' -samAccountName 'psych001' -UserPassword 'Banana5454!' -Description "Job 87241 in IT Services" -UserPrincipalName "psych001@campus.goldsmiths.ac.uk" set-qaduser psych001 -UserPassword 'Banana5454!' ## Some assorted notes below ## Creating an array $myArray = "Banana","Carrot","Pineapple","Cabbage","Turnip","Cauliflower","Beetroot","Celery","Potato","Mushroom","Onion" ## Generating a random number Get-Random -minimum 1 -maximum 101 ## Variations ($a = "Dasher","Dancer","Prancer","Vixen","Comet","Cupid","Donder","Blitzen" ) | Get-Random Get-Random -input "Dasher","Dancer","Prancer","Vixen","Comet","Cupid","Donder","Blitzen" ($a = "Dasher","Dancer","Prancer","Vixen","Comet","Cupid","Donder","Blitzen" ) | Get-Random -count 3 Get-Content C:\Scripts\Test.txt | Get-Random Get-ChildItem C:\Scripts | Get-Random -count 3