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.
Write a Powershell script to create a Windows user account that is a non-admin user. This...
Write a Powershell script to create a Windows user account that is a non-admin user. This assignment assumes that you already have a Windows VM, with the administrator account created.. To complete the assignment, write the PowerShell script, run it on your VM, and submit the script here.
Research the Windows PowerShell commands for manipulating the firewall and construct a command that lists all...
Research the Windows PowerShell commands for manipulating the firewall and construct a command that lists all the firewall rules on a system with the output containing the information and headers below: Rule name TCP port Enabled
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
Linux Use touch to create a file in your working directory called PutFileHere this is a...
Linux Use touch to create a file in your working directory called PutFileHere this is a linux question i acidentally put javascript when i first submitted it
Write a script in C that will do the following : 1. Create the directory ZHW3....
Write a script in C that will do the following : 1. Create the directory ZHW3. 2. Verify that the directory is created by display all information related to the directory and not just the name of the directory. 3. Assume that the input from the command is used to validate password strength. Here are a few assumptions for the password string. • Length – minimum of 8 characters. • Contain alphabets , numbers , and @ # $ %...
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.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT