PowerShell Folder Permissions Scripted

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

Комментарии • 12

  • @somyapattanayak6995
    @somyapattanayak6995 3 года назад

    hey thank you so much .this is very helpful for me. thank you for the script , sir :)

  • @riffsontwowheels
    @riffsontwowheels 2 года назад

    How does one remove individual users from folder permissions and add them to RO RWM FULL groups instead, rather than opening files and folders and removing and adding one by one for thousands of users?

  • @jiangrui5949
    @jiangrui5949 Год назад

    It will mess up the current access group if the folder path is a on a remote server such as \\server2022\folder after running the script. The folder will then have the group created by script only. Once you remove this group, the default access group will be back again. Do you have any idea why this happen? Thank you in advance.

  • @PrathapMD-pn5tt
    @PrathapMD-pn5tt Год назад

    Is it possible to check the permissions of a User for the folder? First, I have to validate the user's existing permission for the specified folder, if permissions are there which I expect then I don't need to add the user to any groups which have required permissions.

    • @TipsForITPros
      @TipsForITPros  Год назад

      Such things are always possible.
      You would do some thing like get the user id and any groups they are member of and check that against existing assignments

  • @somyapattanayak6995
    @somyapattanayak6995 3 года назад

    by the another question how can i add a user in a group which have "read ", "write" , "modify" permission access for a folder .

    • @TipsForITPros
      @TipsForITPros  3 года назад

      for that you just need to change the filter on line 6
      docs.microsoft.com/en-us/dotnet/api/system.security.accesscontrol.filesystemrights?view=net-5.0

    • @somyapattanayak6995
      @somyapattanayak6995 3 года назад

      @@TipsForITPros the user needs read ,write and modify permission, then there is a group present having these 3 permission ,then what should be the script .
      $groups = $acl.access.where({$_.filesystemrights -match "Read" -AND $_.filesystemrights -match "write" -AND $_.filesystemrights -match "modify" -AND $_.IdentityReference -notmatch "BUILTIN" -AND $_.IdentityReference -notmatch "$env:COMPUTERNAME" })
      is it ? is the above written script correct ?

    • @JohnHallunique
      @JohnHallunique 3 года назад

      @@somyapattanayak6995 You should test it, but yes that looks about right.

  • @Thought-Hive
    @Thought-Hive 2 года назад

    How to give permission to a global group from a different domain in the same environment. I meant the change location option.

    • @TipsForITPros
      @TipsForITPros  2 года назад

      This is the one for you ruclips.net/video/-PnkS2ixQ74/видео.html