Question

In: Computer Science

Windows PowerShell Log in as Tawny Madison and create a directory called c:\users\tmadison\research and within it,...

Windows PowerShell

Log in as Tawny Madison and create a directory called c:\users\tmadison\research and within it, another directory called departmental meeting minutes. Set the permissions on the departmental meeting minutes directory so that the user tmadison can read and modify it, any other members of the research group can only read it, and no one else can do anything with it. (If someone is listed as belonging to both the research group and another group, they should still be allowed to read it.)

This is what I have so far:

1) New-Item -Path “c:\users\tmadison\research\departmental meeting minutes” -ItemType “directory”

2) Icacls “c:\users\tmadison\research\departmental meeting minutes” /grant “user”:r

I used New-Item to create the directory but I'm having trouble setting up permissions for the directory "departmental meeting minutes".

These are the permissions I need to set up using PowerShell.

"tmadison" Owner = Read & Modify

"research" Group = Read Only

Everyone else = Cannot do anything with it

Solutions

Expert Solution

$folderPath = "c:\users\tmadison\research\departmental meeting minutes"
$readOnly = [System.Security.AccessControl.FileSystemRights]"ReadAndExecute"
$readWrite = [System.Security.AccessControl.FileSystemRights]"Modify"

# Inheritance
$inheritanceFlag = [System.Security.AccessControl.InheritanceFlags]"ContainerInherit, ObjectInherit"
# Propagation
$propagationFlag = [System.Security.AccessControl.PropagationFlags]::None
$type = [System.Security.AccessControl.AccessControlType]::Allow

$objACL = Get-ACL $folderPath

#Set access for everyone to deny
icacls $folderPath /inheritance:r /deny "*S-1-1-0:(OI)(CI)(F)" "*S-1-5-7:(OI)(CI)(F)"

$accessControlEntryRW = New-Object System.Security.AccessControl.FileSystemAccessRule @("domain\tmadison", $readWrite, $inheritanceFlag, $propagationFlag, $type)
$accessControlEntryR = New-Object System.Security.AccessControl.FileSystemAccessRule @("domain\research", $readOnly, $inheritanceFlag, $propagationFlag, $type)

#set rules for user and group
$objACL.AddAccessRule($accessControlEntryRW)
$objACL.AddAccessRule($accessControlEntryR)
Set-ACL $folderPath $objACL


Related Solutions

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.
In STS, create Java Project, called java_generics_yourNameLastname that; (Under source directory called, src, create a package...
In STS, create Java Project, called java_generics_yourNameLastname that; (Under source directory called, src, create a package csci3444.generics and put all code in it) Create a generic interface called “MyGenInterface” that takes 2 generic types K,V with below methods; public K getKey(); public V getValue(); Create a generic class called “MyGenClass” that implements “MyGenInterface” interface. has attributes “K key” and “V value” that can be inherited has a constructor that takes “K _key”, “V _value” inputs and initializes “key”, “value” attributes...
Use a powershell script to bulk create 10 users (sales1, sales2, ...) inside OU=MyBusiness, OU=Users, OU=Sales,...
Use a powershell script to bulk create 10 users (sales1, sales2, ...) inside OU=MyBusiness, OU=Users, OU=Sales, save script to desktop
You first needs to create a file called “myJS.js” in your project directory. Then, include the...
You first needs to create a file called “myJS.js” in your project directory. Then, include the AngularJS library and myJS.js in the header of the index.html page. Now, you need to define your angular application and a controller in this file such that the controller has the following variables with these initial values: name = "Alex Cool"; faculty= "Faculty of Busienss and IT"; university = {name:"University of Ontario Institute of Technology", url:"http://www.uoit.ca"}; contacts = {email:"[email protected]", phone:"xxx-xxx-xxxx"}; skills = [ {name:...
***IN C# ONLY, USING WINDOWS FORMS*** --NO JAVA--. Create a GUI application in C# that calculates...
***IN C# ONLY, USING WINDOWS FORMS*** --NO JAVA--. Create a GUI application in C# that calculates and displays the total travel expenses of a business person on a trip. Here is the information that the user must provide: • Number of days on the trip • Amount of airfare, if any • Amount of car rental fees, if any • Number of miles driven, if a private vehicle was used • Amount of parking fees, if any • Amount of...
Must be in Visual C# using windows forms : Create an application that opens a specified...
Must be in Visual C# using windows forms : Create an application that opens a specified text file and then displays a list of all the unique words found in the file. Hint: Use a LINQ method to remove all duplicate words.
In C# Create a windows application which accepts the month number and displays the month name...
In C# Create a windows application which accepts the month number and displays the month name in a label.   Use a nested if... else statement to determine the month name. For months not in the range 1-12 display the message "Not a valid month"
Windows Forms application using Visual Basic: Create a class called Character that a role-playing game might...
Windows Forms application using Visual Basic: Create a class called Character that a role-playing game might use to represent a character within the game. A character should include six stats as instance variables – strength, dexterity, constitution, intelligence, wisdom and charisma (all types are int). Your class should have a constructor that initializes these six instance variables. Provide Properties with an appropriate set and get block for each instance variable. In addition, provide a method named getStatsTotal that calculates the...
Create a C# Windows Console application that displays the following patterns separately, one after the other....
Create a C# Windows Console application that displays the following patterns separately, one after the other. You MUST use nested for loops to generate the patterns. All asterisks (*) should be displayed by a single statement of the form Console.Write("*"); which causes the asterisks to display side by side. A statement of the form Console.WriteLine(); can be used to move to the next line. A statement of the form Console.Write(" "); can be used to display a space for the...
This is c++ Create a program where you create, display, search, delete elements within a linked...
This is c++ Create a program where you create, display, search, delete elements within a linked list. Watch your function arguments. Pointer parameters are passed by reference to some functions and by value to others. Functions to make: copy : copies element in linked list destroy all: destroys all elements in linked list wherethisgoes:user  enters element and returns where the element is located insert sorted: inserts element create using linked lists with a head pointer and so forth
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT