Question

In: Other

Create 3 PowerShell Scripts. The first 2 are worth 2 points each. The 3rd one is extra credit, wo...

Create 3 PowerShell Scripts. The first 2 are worth 2 points each. The 3rd one is extra credit, worth 1 point.

Script 1: Add/Remove Users
Fields: Username, FirstName, LastName, Description, OUPath, Password, Action (Add | Remove)

Script 2: Create Security Groups
Fields: Name, Description, OUPath, Scope (DomainLocal | Global | Universal), Category (Distribution | Security)

Script 3: Modify Security Group Membership
Fields: GroupName, Username, Action (Add | Remove)

Solutions

Expert Solution

Question 1

Add User

Import-Module activedirectory
  
$diiffsu = Import-csv C:\test.csv

foreach ($User in $diiffsu)
{
      
   $uname    = $User.username
   $paswd    = $User.password
   $fname    = $User.firstname
   $lname    = $User.lastname
   $OU        = $User.oupath
   $description = $User.department


   if (Get-ADUser -F {SamAccountName -eq $uname})
   {
      
       Write-Warning "User Already Exist"
   }
   else
   {

       New-ADUser `
-SamAccountName $uname `
-UserPrincipalName "[email protected]" `
-Name "$fname $lname" `

-GivenName $fname `
-Surname $lname `
-Enabled $True `
-DisplayName "$lname, $fname" `
-Path $OU `
   -Description $description
-AccountPassword (convertto-securestring $paswd -AsPlainText -Force) -ChangePasswordAtLogon $True
  
   }
}

Remove User

remove-aduser $username -confirm:$false

Question 2

New-ADGroup -Name $grpname -SamAccountName -GroupCategory $grpcat -GroupScope $grpscp -Description "Members of this group are Administrators"


Related Solutions

a. Using Matlab scripts create the following matrices (???1 and ???2) ???1 = [ 3 2...
a. Using Matlab scripts create the following matrices (???1 and ???2) ???1 = [ 3 2 −3 6 7 4 3 −6 7 ], ???2 = [ 2 1 7 3 3 9 −6 6 1 ]    b. Write code to add the second row of ???1 to the third row of ???2 and store results in the first row of ???1. c. Write code to add the second column of ???1 with the third column of ???2 and...
Each is worth 4 points. Show or explain your work for partial credit. Draymond wants to take a 2-year training course that costs $5,000 each year.
Each is worth 4 points. Show or explain your work for partial credit. Draymond wants to take a 2-year training course that costs $5,000 each year. His company promises a $1,000 raise for anyone who takes the course. Draymond currently makes $70,000 and will retire 10 years after completing the training. He will continue to work while he takes the training course. Assume a discount rate of 0.07. What is the Present Value of the cost of taking the course?...
Part 2 contains 3 Decision making recommendations that are independent of each other worth 2 pts....
Part 2 contains 3 Decision making recommendations that are independent of each other worth 2 pts. Each for a total of 6 pts.  Covers material in Module 17 Decision Making  #1-Special Order Snider, Inc., which has excess capacity, received a special order for 2,000 units at a price of $15 per unit which it could produce with the excess capacity. Currently, production and sales are anticipated to be 10,000 units without considering the special order. Budget information for the current year sales...
Assume that buyers are located along a line at points 1, 2 and 3. Each has a reservation price equal to 10.
Assume that buyers are located along a line at points 1, 2 and 3. Each has a reservation price equal to 10. Marginal cost and average cost are equal to 4. There are 4 buyers located at points 1 and 3, and 2 buyers located at point 2. Seller A is located at point 1 and seller B is located at point 3. Transport cost is t = 1. When the price for both sellers is the same for a...
Create a nursing care plan with 2 nursing diagnosis, one short term goal for each diagnosis,...
Create a nursing care plan with 2 nursing diagnosis, one short term goal for each diagnosis, per diagnosis 5 interventions with rationale, and evaluation for the following patient. 75 y/o day #3 F nx HTN, DM, CAD/MI, CVA X2 W/ recent admission who presented as a notification for AMS & hypotension with unknown last know well. Noted to be hypothermia normotensive following limited commands not responding verbally withdrawing pain improved with IV bolus and warming blanket. Concern for transient AMS...
2.From which diagnostic category is one least likely to recover? 3.What is the first and second...
2.From which diagnostic category is one least likely to recover? 3.What is the first and second most common mental disorders in the USA? 4.How does "culture" relate to the diagnostic categories?
How this command used for and provide examples for each one. Commands: 1-file 2-find 3-pwd 4-ln...
How this command used for and provide examples for each one. Commands: 1-file 2-find 3-pwd 4-ln 5-stat 6- cmp, comm, and diff 7-md5sum 8-du 9-gzip 10-gunzip 11-bzip2, and bunzip 12-cpio 13-tar 14-wc 15-vi editor
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT