Difference between revisions of "Quest powershell to create a batch of users"

From MyWiki
Jump to: navigation, search
Line 7: Line 7:
  
 
## Creating an array
 
## Creating an array
$myArray = "Banana","Carrot","Pineapple","Cabbage","Turnip","Cauliflower","Beetroot","Celery","Potato","Mushroom","Onion","Jupiter","Scorpio","Andromeda","Andromeda","Capricorn","Centaurus",
+
$myArray = "Banana","Carrot","Pineapple","Cabbage","Turnip","Cauliflower","Beetroot","Celery","Potato","Mushroom","Onion","Jupiter","Scorpio","Andromeda","Andromeda","Capricorn","Centaurus","Cygnus"
  
 
## Generating a random number
 
## Generating a random number

Revision as of 10:08, 9 February 2015

New-QADUser -name 'psych001' -ParentContainer 'OU=Visitors_and_Guests,OU=Boldsmiths_Users,DC=camping,DC=boldsmiths,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","Jupiter","Scorpio","Andromeda","Andromeda","Capricorn","Centaurus","Cygnus"
 
## Generating a random number
Get-Random -minimum 1 -maximum 101
 
## Variations
($a = "Dasher","Dancer","Prancer","Vixen","Comet","Cupid","Donder","Blitzen" ) | Get-Random   ## Select a random name
Get-Random -input "Dasher","Dancer","Prancer","Vixen","Comet","Cupid","Donder","Blitzen"     ## Select a random name
($a = "Dasher","Dancer","Prancer","Vixen","Comet","Cupid","Donder","Blitzen" ) | Get-Random -count 3  ## Select multiple 
Get-Content C:\Scripts\Test.txt | Get-Random    ## Select a random line ?
Get-ChildItem C:\Scripts | Get-Random -count 3   ## Select a random file name ?