Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Changing Share permissions on 950 user accounts in the same folder

$
0
0

I need to re-install a server OS but to increase the OS drive size I need to move my Student home folders to another drive so I can re-partition the RAID V array. I copied the files to another drive I did this using Robocopy (thanks Spiceworks users) but I cannot find a way to re-instate the share permissions on the top folder of each students folder. Currently each of the 950 students have a folder labelled something like "astudent" and the folder is shared as "astudent$".

I can use the net share command to apply the permissions I want to one student folder but I had to rename the student folder to "astudent$" to get the command to work. This command worked for me on Server 2003 (which I want to replace with Server 2008 r2):

NET SHARE astudent$=j:\students\astudent$ /GRANT:"Authenticated Users",FULL

My question is: Is there a way to write a script which will cahnge each folder one after the other so that I don't have to sit there for a week with a mouse or keep editing this line and running it for each student?


Viewing all articles
Browse latest Browse all 15370

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>