Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: amending permissions on folders using powershell

22 Aug 2017   #1

windows 7 premiumx64
amending permissions on folders using powershell

Hi All
I've been using the following script I found on here to create a new set of folders on our server from a txt file.

However, when I run it the user is not able to add new items under the new folder. I need to be able to change the advanced security settings so that the user has full rights to this folder and any sub-folders, files underneath. I guess its just a change of something but ive tried adding loads of different items in the $acl.SetAccessRules but nothing seems to work

powershell script to create user folders and set permissions

$Users = Get-Content "C:\2017temp.txt"
ForEach ($user in$users)
$newPath = Join-Path"\\cvhsfp01\student_home\2017" -childpath $user
New-Item $newPath-type directory
$acl = Get-Acl$newpath
$permission ="domain\$user","FullControl","Allow"
$accessRule =New-Object System.Security.AccessControl.FileSystemAccessRule $permission
$acl | Set-Acl$newpath

Any help would be appreciated.


My System SpecsSystem Spec

 amending permissions on folders using powershell

Thread Tools

Similar help and support threads
Thread Forum
System Folders Permissions Error
I have two computers both exhibiting the same problem. One is a Dell desktop, the other a HP laptop, both are running windows 7 Home Premium x64. I have a homegroup set up and also share a set of folders on the Dell. My difficulty is that although logged on as an administrator, I cannot...
General Discussion
powershell script to create user folders and set permissions
Wondering if anyone in this forum can help me figure out what I am doing wrong with my script. I am grabbing a text file with a list of users in it. I want to then create folders for all those people and then set explicit permissions on those folders to only allow the users and admin access to it....
set read-only permissions for folders and files
I have an image of my the hard drive from my XP system on an external drive. I'd like to copy the entire file structure to the windows 7 hard drive, retaining the folder structure. Then I'd like to set all the folders, sub-folders, and files to read-only to protect myself from accidentally...
General Discussion
Adding group to a folders permissions?
I deleted a user from a folders permissions figuring I could add it back. When I go to do that the "Add" button is greyed out and I can't do it. What am I doing wrong? Thanks in advance!
General Discussion
permissions to access folders
recently when i updated my os from vista to windows 7 ..there were some folders (containing mp3's ) which were on sharing on lan.. now.. all those files that were being shared required me to take ownership of it before i can access it.. i have more than 3000 songs and its not quite practical for me...
System Security

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 11:00.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App