Jump to content

Find specific files and change ownership and permissions


Recommended Posts

Posted (edited)

I am looking for a script that will search all folders and subfolder for "Favourites" then to take ownership of this file and add permissions.

 

It appears all of our Favourites folders within each user on the server no longer has an owner.

 

Many thanks - Would say a LOT of time!

Edited by rpettit
Posted
I am looking for a script that will search all folders and subfolder for "Favourites" then to take ownership of this file and add permissions.

 

It appears all of our Favourites folders within each user on the server no longer has an owner.

 

Many thanks - Would say a LOT of time!

 

 

What permissions do you need to set?

 

A quick bit of powershell code that will find all versions of Favourites would be:

 

Get-ChildItem -Path "\\Server\Sharedfolder" -Recurse -Directory | Where {$_.Name -eq "Favorites"} | Select FullName

 

Depending on what permissions you want to set it can then be pretty easily modified to take ownership and add the permissions.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...