1
General Software Discussion / Re: Script to set read+write permissions to folders for users based on foldername
« on: April 03, 2018, 01:32 PM »
Thanks for the two replies.
4wd's, being the shortest would be nice but so far i can't get it to quite work. I am sure i did something wrong with the new modules i had to import. I saw it flash something in red but have not rerun
> UPDATE The error says: add-NTFSAccess : The 'Add-NTFSAccess' command was found in the module 'NTFSSecurity', but the module could not be loaded. So i am working on that one
> Says something about the file not being digitally signed ;( Also get further and just more messages telling me that for some reason the NTFSSecurity module is not going to run on this system ;((
PS: I should add that this is a fully Up-to-date Windows 10 vr 1709 (Creator update installed) system, not Windows server and not Windows 10 1703. That might make a difference. Also the folders are accessed by the Users over the LAN in-house network, not directly from the system they are on. All folders have the default shares of Admin as Owner. The only thing i am trying to do is add each user to have access to their folder which is a folder named for them. I normally add read/write for each user when i create the folders. It is ONLY this one share permission that gets removed somehow on rare occasions. The owner-share for admin is not changed when the other shares are removed.
Flatop0315. On yours, i modified slightly making use of the $source variable you setup in line 1 and reused it in line 5 and 8 so this would be more universal and only need to state the folder-name once. Thereafter using $source. It appeared to work fine on a short test but did something i am not accustomed to for the sharing permissions.
When i looked under the "Share" option it plainly says "not shared" so at first I thought the command had failed.
However, when i looked under the "Share" option for that folder it did show that user's name but with the permissions set to 'Contribute'.
When i normally create these I don't even see that option. I just click Share, add the username it is shared with and the permissions of read/write.
I noticed that the arrow beside 'contribute' would allow change to 'read/write'. I tried to look up what the differences were and got even more confused.
But the main worry is that even with that user listed, the folder does not show up as being shared at all. Even when checking under Advanced system properties for all shared access.
PS: I did run the script under PowerShell as Admin
These folders serve as a backup for the employees desktop, documents and download files. They are added to on a daily basis and while not perfect, have saved a few people from some major losses.
Any ideas on how to resolve this would be appreciated. Perhaps i still did something wrong and i am continuing to test both versions
4wd's, being the shortest would be nice but so far i can't get it to quite work. I am sure i did something wrong with the new modules i had to import. I saw it flash something in red but have not rerun
> UPDATE The error says: add-NTFSAccess : The 'Add-NTFSAccess' command was found in the module 'NTFSSecurity', but the module could not be loaded. So i am working on that one
> Says something about the file not being digitally signed ;( Also get further and just more messages telling me that for some reason the NTFSSecurity module is not going to run on this system ;((
PS: I should add that this is a fully Up-to-date Windows 10 vr 1709 (Creator update installed) system, not Windows server and not Windows 10 1703. That might make a difference. Also the folders are accessed by the Users over the LAN in-house network, not directly from the system they are on. All folders have the default shares of Admin as Owner. The only thing i am trying to do is add each user to have access to their folder which is a folder named for them. I normally add read/write for each user when i create the folders. It is ONLY this one share permission that gets removed somehow on rare occasions. The owner-share for admin is not changed when the other shares are removed.
Flatop0315. On yours, i modified slightly making use of the $source variable you setup in line 1 and reused it in line 5 and 8 so this would be more universal and only need to state the folder-name once. Thereafter using $source. It appeared to work fine on a short test but did something i am not accustomed to for the sharing permissions.
When i looked under the "Share" option it plainly says "not shared" so at first I thought the command had failed.
However, when i looked under the "Share" option for that folder it did show that user's name but with the permissions set to 'Contribute'.
When i normally create these I don't even see that option. I just click Share, add the username it is shared with and the permissions of read/write.
I noticed that the arrow beside 'contribute' would allow change to 'read/write'. I tried to look up what the differences were and got even more confused.
But the main worry is that even with that user listed, the folder does not show up as being shared at all. Even when checking under Advanced system properties for all shared access.
PS: I did run the script under PowerShell as Admin
These folders serve as a backup for the employees desktop, documents and download files. They are added to on a daily basis and while not perfect, have saved a few people from some major losses.
Any ideas on how to resolve this would be appreciated. Perhaps i still did something wrong and i am continuing to test both versions