Made a powershell to add users to win server
Made it for Fredrik
This commit is contained in:
		
							parent
							
								
									4ed821f1ae
								
							
						
					
					
						commit
						cf923bb63e
					
				
							
								
								
									
										19
									
								
								Commissions/Fredrik/Make Users.ps1
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								Commissions/Fredrik/Make Users.ps1
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,19 @@
 | 
				
			|||||||
 | 
					############################################
 | 
				
			||||||
 | 
					## Script by Daniel Løvbrøtte Olsen, 1ELA ##
 | 
				
			||||||
 | 
					## For Fredrik Refstie                    ##
 | 
				
			||||||
 | 
					############################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$Users = Import-Csv .\Users.csv
 | 
				
			||||||
 | 
					forEach ($User in $Users)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    $first = $User.first[0..1]
 | 
				
			||||||
 | 
					    $last = $User.last[0..2]
 | 
				
			||||||
 | 
					    $username = "$first$last"
 | 
				
			||||||
 | 
					    $username = $username -replace " ", ""
 | 
				
			||||||
 | 
					    "dsadd user `"cn=$username, ou=Illuminati, dc=datavg2, dc=local -fn Joetta -ln Heckel pwd Admin123" | out-file run.bat -Encoding "UTF8" -Append
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					"echo Script has  finished running, thanks based Daniel in 1ELA for making our lives easier" | out-file run.bat -Encoding "UTF8" -Append
 | 
				
			||||||
 | 
					"PAUSE" | out-file run.bat -Encoding "UTF8" -append
 | 
				
			||||||
 | 
					"@ECHO OFF" | out-file run.bat -Encoding "UTF8" -append
 | 
				
			||||||
 | 
					"DEL `"%~f0`"" | out-file run.bat -Encoding "UTF8" -append
 | 
				
			||||||
 | 
					Start-Process "cmd.exe" "/c run.bat"
 | 
				
			||||||
							
								
								
									
										70
									
								
								Commissions/Fredrik/Users.csv
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										70
									
								
								Commissions/Fredrik/Users.csv
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,70 @@
 | 
				
			|||||||
 | 
					first,last
 | 
				
			||||||
 | 
					Travis,Garden
 | 
				
			||||||
 | 
					Payton,Gas
 | 
				
			||||||
 | 
					Alaura,Gate
 | 
				
			||||||
 | 
					Jessica,Gemstone
 | 
				
			||||||
 | 
					Tyler,Girl
 | 
				
			||||||
 | 
					Madelyn,Gloves
 | 
				
			||||||
 | 
					Chloe,God
 | 
				
			||||||
 | 
					Ainsleigh,Grapes
 | 
				
			||||||
 | 
					Joshua,Guitar
 | 
				
			||||||
 | 
					Cara,Hammer
 | 
				
			||||||
 | 
					Jadyn,Hat
 | 
				
			||||||
 | 
					Thomas,Hieroglyph
 | 
				
			||||||
 | 
					Savannah,Highway
 | 
				
			||||||
 | 
					Kylie,Horoscope
 | 
				
			||||||
 | 
					Alexa,Horse
 | 
				
			||||||
 | 
					Austin,Hose
 | 
				
			||||||
 | 
					Conner,Ice
 | 
				
			||||||
 | 
					Madison,Ice-cream
 | 
				
			||||||
 | 
					Peyton,Insect
 | 
				
			||||||
 | 
					Cadence,Jet fighter
 | 
				
			||||||
 | 
					Luke,Junk
 | 
				
			||||||
 | 
					Connor,Kaleidoscope
 | 
				
			||||||
 | 
					Avary,Kitchen
 | 
				
			||||||
 | 
					Khloe,Knife
 | 
				
			||||||
 | 
					Trevor,Leather jacket
 | 
				
			||||||
 | 
					Cheyenne,Leg
 | 
				
			||||||
 | 
					Jeriah,Library
 | 
				
			||||||
 | 
					Avery,Liquid
 | 
				
			||||||
 | 
					Cailin,Magnet
 | 
				
			||||||
 | 
					Jordan,Man
 | 
				
			||||||
 | 
					KaliAnna,Map
 | 
				
			||||||
 | 
					Tyler,Maze
 | 
				
			||||||
 | 
					Jakob,Meat
 | 
				
			||||||
 | 
					Madison,Meteor
 | 
				
			||||||
 | 
					Kylie,Microscope
 | 
				
			||||||
 | 
					Logan,Milk
 | 
				
			||||||
 | 
					Austin,Milkshake
 | 
				
			||||||
 | 
					Emma,Mist
 | 
				
			||||||
 | 
					Bryce,MoneyYo
 | 
				
			||||||
 | 
					Meg,Monster
 | 
				
			||||||
 | 
					Calin,Mosquito
 | 
				
			||||||
 | 
					Hailey,Mouth
 | 
				
			||||||
 | 
					Trey,Nail
 | 
				
			||||||
 | 
					Breanna,Navy
 | 
				
			||||||
 | 
					Autumn,Necklace
 | 
				
			||||||
 | 
					Dawson,Needle
 | 
				
			||||||
 | 
					Mason,Onion
 | 
				
			||||||
 | 
					Logan,PaintBrush
 | 
				
			||||||
 | 
					Madison,Pants
 | 
				
			||||||
 | 
					Alexandra,Parachute
 | 
				
			||||||
 | 
					Alaina,Passport
 | 
				
			||||||
 | 
					Raychel,Pebble
 | 
				
			||||||
 | 
					Tucker,Pendulum
 | 
				
			||||||
 | 
					Brady,Pepper
 | 
				
			||||||
 | 
					Booker,Perfume
 | 
				
			||||||
 | 
					Cara,Pillow
 | 
				
			||||||
 | 
					Cooper,Plane
 | 
				
			||||||
 | 
					Braxton,Planet
 | 
				
			||||||
 | 
					Jasmine,Pocket
 | 
				
			||||||
 | 
					Easton,Post-office
 | 
				
			||||||
 | 
					Paige,Potato
 | 
				
			||||||
 | 
					Joseph,Printer
 | 
				
			||||||
 | 
					Owen,Prison
 | 
				
			||||||
 | 
					Mallory,Pyramid
 | 
				
			||||||
 | 
					Shayla,Radar
 | 
				
			||||||
 | 
					Devin,Rainbow
 | 
				
			||||||
 | 
					Sloan,Record
 | 
				
			||||||
 | 
					Elizabeth,Restaurant
 | 
				
			||||||
 | 
					Cadence,Rifle
 | 
				
			||||||
		
		
			
  | 
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user