Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Recursively changing permissions on folders with long path names

$
0
0

I've gotten a request to change permissions on specific folders for every branch office my organization has - 260+. I'm ok getting the folders, but I'm not sure the output/variable will be ok to pass it into the next command.

$folders = gci -Recurse -path q:\ -include *"Long Foldername Search"* | select name

Will the output from that be suitable to pass to a command to change permissions assuming I can work with foldernames over 248 characters? I'm thinking I'll need a foreach statement, but I've never changed folder permissions in PowerShell before.


zarberg@gmail.com


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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