Question

In: Computer Science

In PowerShell ISE create a script. Use the text file “its3410Users.txt” (found on Canvas) and import...

In PowerShell ISE create a script.

Use the text file “its3410Users.txt” (found on Canvas) and import the users into your domain controller. The user file has a first name, last name, and department. Using this information, create users with the following specifications:

  • Username will be first name.last name
  • User Principal Name will be first name.last [email protected]
  • The department signifies the OU that the user will be placed into
    • If the department does not exist, create it
  • Fill in the first name, last name, and display name fields in the user record
  • Force the user to change the password on logon
  • Have the account enabled
  • Default password for all users will be “Ch@nge123Me!”

Solutions

Expert Solution

I have used powershell 2.0.

$datas = Get-Content –Path C:\ its3410Users.txt 
$passwrd = “Ch@nge123Me!”
 
foreach ($data in $datas){
$firstname = $data.firstname
$lastname = $data.lastname
$username = $firstname + “.” +$lastname
$user_principal_name =$username + “@its3410.net
$partial_data = $username + “,” + $user_principal_name
}
 
if ( $department –eq  'OU' ){
$user = $partial_data + “,OU”
}
if ( $department -eq NULL ){
$user = $partial_data + “,NA” 
}
}
 
if ( $login_attempt){
Write-Verbose "Change Password"
}
$datas = Get-Content –Path C:\ its3410Users.txt 
$passwrd = “Ch@nge123Me!”
 
foreach ($data in $datas){
$firstname = $data.firstname
$lastname = $data.lastname
$username = $firstname + “.” +$lastname
$user_principal_name =$username + “@its3410.net
$partial_data = $username + “,” + $user_principal_name
}
 
if ( $department –eq  'OU' ){
$user = $partial_data + “,OU”
}
if ( $department -eq NULL ){
$user = $partial_data + “,NA” 
}
}
 
if ( $login_attempt){
Write-Verbose "Change Password"
}

Related Solutions

Using PowerShell ISE or VSCode, create a PowerShell script that will do the following: Create functions...
Using PowerShell ISE or VSCode, create a PowerShell script that will do the following: Create functions to get the following information Local username Local machine name Time zone Current Date Output the data that was collected to the screen Upload the script. Paste a screenshot of the results here
Using PowerShell ISE or VSCode, create a PowerShell script that will do the following: You are...
Using PowerShell ISE or VSCode, create a PowerShell script that will do the following: You are going to create an HTML web page report from a standard processed report. You will use the text file “STUDENTS.TXT” located on Canvas. The script must meet the following requirements: The output file should be named ITS3410-{your name}.htm Every line of data that has a student number (9999-9999) must be included in the report All data must be trimmed No leading white space No...
Use Vi text editor or ATOM to create a bash script file. Use the file name...
Use Vi text editor or ATOM to create a bash script file. Use the file name ayaan.sh. The script when ran it will execute the following commands all at once as script. Test your script file make sure it works. Here is the list of actions the script will do: It will create the following directory structure data2/new2/mondaynews off your home directory. inside the mondaynews, create 4 files sports.txt, baseball.txt, file1.txt and file2.txt. Make sure file1.txt and file2.txt are hidden...
Windows PowerShell 1) Write a PowerShell Script to monitor a file for changes. 2) Write a...
Windows PowerShell 1) Write a PowerShell Script to monitor a file for changes. 2) Write a PowerShell Script to create a user account in a specific OU.
1. How to create a group of users using a PowerShell script. 2. how to create...
1. How to create a group of users using a PowerShell script. 2. how to create a file consisting a group of 3 new user name’s and passwords, 1 to a line in power shell. 3. How to write a script in power shell to delete specific group of users. Prove that it works.
how to create a script file on puTTy script pp1.txt
how to create a script file on puTTy script pp1.txt
Write a Powershell script to create a Windows user account that is a non-admin user. This...
Write a Powershell script to create a Windows user account that is a non-admin user. This assignment assumes that you already have a Windows VM, with the administrator account created.. To complete the assignment, write the PowerShell script, run it on your VM, and submit the script here.
Create a geoprocessing tool from the .py file included (script from this file included below). Use...
Create a geoprocessing tool from the .py file included (script from this file included below). Use any csv file you would like. I will work around that. This is for a programming for GIS class. We work with jupyter, idle, arcgis pro import os import arcpy from arcpy import env input_table = r"C:\Answers\January2018.CSV" output_fc = r"C:\Answers\crime.gdb\January2018_Crime" spRef = arcpy.SpatialReference("NAD 1983 StatePlane Missouri East FIPS 2401 (US Feet)") gdb_name = os.path.dirname(output_fc) fc_name = os.path.basename(output_fc) env.overwriteOutput = True print("Creating File GDB") arcpy.CreateFileGDB_management(os.path.dirname(gdb_name),...
Create a bash script file named assessment-script-a that: 1. Accepts any number of file names on...
Create a bash script file named assessment-script-a that: 1. Accepts any number of file names on the command line 2. For each file name provided, delete any line that contains the string: qwe.rty When the changes are completed, the script should display the total number of files scanned, and the total number of files changed. Example Command: assessment-script-a file.a file.b file.c file.d file.e    Example Output: 5 files scanned, 3 files changed 3. Your script should include a series of...
Word Frequencies (Concordance)    1. Use a text editor to create a text file (ex: myPaper.txt)...
Word Frequencies (Concordance)    1. Use a text editor to create a text file (ex: myPaper.txt) It should contain at least 2 paragraphs with around 200 or more words. 2. Write a Python program (HW19.py) that asks the user to provide the name of the text file. Be SURE to check that it exists! Do NOT hard-code the name of the file! Use the entry provided by the user! read from the text file NOTE: (write your program so that...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT