Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Update-PWFolderSecurity replaces all existing security
    • Sign In

    • State Not Answered
    • Replies 6 replies
    • Subscribers 64 subscribers
    • Views 2835 views
    • Users 0 members are here
    • update-pwfoldersecurity
    • powershell
    • ProjectWise

    Update-PWFolderSecurity replaces all existing security

    Mohammad Masud
    Offline Mohammad Masud over 5 years ago

    Hello scripting guy!

    Hope this finds you well. 

    I noticed, "Update-PWFolderSecurity" replaces all existing security groups in a folder instead of updating/adding just the one defined in the cmdlet run. For example, if a folder "Test" had three groups "grp-1", "grp-2" and "grp-3" in folder security, and all had "create subfolder" rights, then the following replaces all groups with "grp-1" with read rights, and erasing all the previous groups in the process.

    Update-PWFolderSecurity -InputFolder Test -MemberType g -MemberName "grp-1" -MemberAccess 'r' -FolderSecurity

    What I really wanted was the folder to have grp-1 updated to have read permission only and keep grp-2 and grp-3 to have permissions the same as before.

    Any suggestion?

    Thanks,
    Mohammad

    • Sign in to reply
    • Cancel

    Top Replies

    • Brian Flaherty
      Offline Brian Flaherty Fri, Mar 2 2018 12:51 PM +1
      Were the original access control entries being inherited? If yes, you would need to include the -IncludeInheritance switch parameter to maintain those entries.
    • D.Widdifield
      0 Offline D.Widdifield Thu, Mar 1 2018 2:05 PM

      Interesting because I just did the exact thing today, processed over 500 projects. Basically took an existing User list and removed editing capabilities, made them read only by using the Project Observer option. Each project has multiple user list assignments which all remained as is. Give this one a try.

      Update-PWFolderSecurity -InputFolder $Folder1 -MemberName $Userlist -MemberType ul -DocumentSecurity -FolderSecurity -Role "Project Observer" 

      d

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Mohammad Masud
      0 Offline Mohammad Masud Thu, Mar 1 2018 5:42 PM in reply to D.Widdifield

      Thanks for your response. 

      Yes, role works better than member access, but the problem with role is it changes both folder and document securities at the same time, even when you only want to change one. So you may want to give a power user permission to change permission in a folder so he can create a project, but may not necessarily give him permission to change permission of documents within. If you choose the role "Project Administrator", it will give you full control to both folders and documents. 

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Brian Flaherty
      0 Offline Brian Flaherty Fri, Mar 2 2018 12:51 PM

      Were the original access control entries being inherited? If yes, you would need to include the -IncludeInheritance switch parameter to maintain those entries.

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Mohammad Masud
      0 Offline Mohammad Masud Fri, Mar 2 2018 7:07 PM in reply to Brian Flaherty

      Thanks Brian. I think that's what it was. 

      Can entries be a mix of inherited and not inherited? Or it is always either 'inherited' or 'none'? Do all entries change to 'none' once an entry's security is updated? 


      So if I only want to update a single entry, the inheritance of which is unknown, should I include -includeInheritance switch regardless? or I should evaluate if the Inheriting_From property, and use the switch if it results true?

      Thanks in advance for your help.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Brian Flaherty
      0 Offline Brian Flaherty Sun, Mar 4 2018 1:04 PM in reply to Mohammad Masud

      Inheritance is all or none. Once an access control entry is added to a folder or document security, you ONLY have explicit access control entries.  You can use the Get-PWFolderAccess to get a list of what access control is applied to a folder. If nothing is returned, it is not inheriting any access control and not is explicitly applied.  Otherwise, the returned access control objects will indicate if it is inherited.

      Example: Get-PWFolderSecurity -InputFolder ( Show-PWFolderBrowserDialog ) -Verbose

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    >

    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies