Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a PowerShell script named Restore - AD . ps 1 within the attached Requirements 2 folder. Create a comment block and include your first
Create a PowerShell script named RestoreADps within the attached Requirements folder. Create a comment block and include your first and last name along with your student ID
B Write the PowerShell commands in RestoreADps that perform all the following functions without user interaction:
Check for the existence of an Active Directory Organizational Unit OU named Finance Output a message to the console that indicates if the OU exists or if it does not. If it already exists, delete it and output a message to the console that it was deleted.
Create an OU named Finance Output a message to the console that it was created.
Import the financePersonnel.csv file found in the attached Requirements directory into your Active Directory domain and directly into the finance OU Be sure to include the following properties:
First Name
Last Name
Display Name First Name Last Name, including a space between
Postal Code
Office Phone
Mobile Phone
Include this line at the end of your script to generate an output file for submission:
GetADUser Filter SearchBase ouFinance,dcconsultingfirm,dccomProperties DisplayName,PostalCode,OfficePhone,MobilePhone AdResultstxt
C Create a PowerShell script named RestoreSQLps within the attached Requirements folder. Create a comment block and include your first and last name along with your student ID
D Write the PowerShell commands in a script named RestoreSQLps that perform the following functions without user interaction:
Check for the existence of a database named ClientDB. Output a message to the console that indicates if the database exists or if it does not. If it already exists, delete it and output a message to the console that it was deleted.
Create a new database named ClientDB on the Microsoft SQL server instance. Output a message to the console that the database was created.
Create a new table and name it ClientAContacts in your new database. Output a message to the console that the table was created.
Insert the data all rows and columns from the NewClientDatacsv file found in the attached Requirements folder into the table created in part D
Include this line at the end of your script to generate the output file SqlResults.txt for submission:
InvokeSqlcmd Database ClientDB ServerInstance SQLEXPRESS Query SELECT FROM dbo.ClientAContactsSqlResultstxt
E Apply exception handling using trycatch. Output any error messages to the console.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started