Question: Write Your Script: Create a PowerShell script named UserAccountManagement.ps 1 . Prompt the user to enter the location of the SystemUsers.txt file and read the
Write Your Script:
Create a PowerShell script named UserAccountManagement.ps
Prompt the user to enter the location of the SystemUsers.txt file and read the usernames from the file.
For each username in the file, check if the user exists on the system:
If the user does not exist, write a message to the terminal indicating that the account is being created, create the account on the system, and set the password to "password
Prompt the user to enter the location of the TerminatedEmployees.txt file and read the usernames from the file.
For each username in the file, check if the user exists on the system:
If the user exists, delete the account from the system and log the deletion to the terminal.
Handle any errors or exceptions gracefully.
Testing and Validation:
Test your script with different scenarios, including users already existing, new users, and terminated users.
Verify that the script correctly creates new accounts with the password "password and deletes terminated accounts.
Ensure that the script handles errors and provides informative output to the terminal.
Submission:
Submit your PowerShell script UserAccountManagementps after completing the exercise.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
