2

I'm using PowerShell scripts to manage the permissions on our fileservers. In general this works pretty well but sometimes directories are renamed. This does of course not affect the permissions but the script is refering to a database where the wanted permissions are stored. When a directory is renamed the assigned permissions cannot be associated with that directory anymore.

In this situation it would be nice to be able to identify a directory based on filesystem information not based on the name of the directory. Is there a way to do this?

The fileservers are running Windows Server 2012 and we are using NTFS as a filesystem.

davidb
  • 246
  • 1
  • 5
  • 16

1 Answers1

0

This may not be the best way, but it's a place to start anyway. Using the powershell scripts, programmatically make a file marked as system (hidden even when show hidden files is activated) and make sure only you your user (or the user your powershell scripts run under) can access it for read or write. Every time you identify a new folder, add this file to it, and use it to identify the folder (so you could name it "folderid" and have the contents be a GUID you generate and associate with the folder)

Now the only problem is that if a user wants to delete a folder, the write permissions on this file might stop them. You could leave it open for users to delete only, but that's getting into some pretty crazy permissions.

Anyway, It's a place to start. :)

Andrew Hendrix
  • 306
  • 1
  • 8
  • As an aside, windows occasionally uses a similar file to identify special properties of a folder called "desktop.ini" I haven't looked much into it, but you might look into that too. – Andrew Hendrix Sep 09 '16 at 17:22