Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

INTRODUCTION In this task, you will create PowerShell script. PowerShell enables administrators to perform administrative tasks on both local and remote systems. You will be

INTRODUCTION

In this task, you will create PowerShell script. PowerShell enables administrators to perform administrative tasks on both local and remote systems. You will be expected to manage an Active Directory server and an SQL server within the PowerShell environment. This management will include the configuration and administration of the servers.

SCENARIO

You have been hired as a consultant at a company. The company previously had an SQL server and Active Directory server configured throughout two separate Windows 2012 servers. However, all of the drives (including backups) were destroyed due to unforeseen circumstances, and you need to write one PowerShell script named restore.ps1 that can accomplish all of the required tasks from the local server.

REQUIREMENTS

A. Create a PowerShell script named restore.ps1 within the Requirements2 folder. For the first line, create a comment and include your first and last name along with your student ID.

Note: The remainder of this task shall be completed within the same script file, restore.ps1.

B. Write a single script within the restore.ps1 file that performs all of the following functions without user interaction:

1. Create an Active Directory organizational unit (OU) named finance.

2. Import the financePersonnel.csv file (found in the Requirements2 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

3. Create a new database on the UCERTIFY3 SQL server instance called ClientDB.

4. Create a new table and name it Client_A_Contacts. Add this table to your new database.

5. Insert the data from the attached NewClientData.csv file (found in the Requirements2 folder) into the table created in part B4.

C. Apply exception handling using try-catch for System.OutOfMemoryException.

D. Run the script within the uCertify environment. After the script executes successfully, run the following cmdlets individually from within your Requirements2 directory: 1. Get-ADUser -Filter * -SearchBase ou=finance,dc=ucertify,dc=com -Properties DisplayName,PostalCode,OfficePhone,MobilePhone > .\AdResults.txt 2. Invoke-Sqlcmd -Database ClientDB ServerInstance .\UCERTIFY3 -Query SELECT * FROM dbo.Client_A_Contacts > .\SqlResults.txt

Note: Ensure you have all of the following files intact within the Requirements2 folder, including the original files:

restore.ps1

AdResults.txt

SqlResults.txt

E. Compress the Requirements2 folder as a ZIP archive. When you are ready to submit your final task, run the Get-FileHash cmdlet against the Requirements2 ZIP archive. Note the hash value and place it into the comment section when you submit your task.

Edit: The submission contains the PowerShell script and two input csv files. The hard coded paths to the input files will need to be removed the script should use the local files to run. The submission should also include the SQL results and AD results files.

Please inform what kind of extra information is needed.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students explore these related Databases questions