Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum New-PWRichProject How to skip copying access control permissions from the template work area?
    • Sign In

    • State Not Answered
    • Replies 8 replies
    • Subscribers 66 subscribers
    • Views 974 views
    • Users 0 members are here
    • powershell
    • ProjectWise PowerShell Modules

    New-PWRichProject How to skip copying access control permissions from the template work area?

    Bhanu Chauhan
    Offline Bhanu Chauhan over 2 years ago

    I'm using an Excel to create a New Work Area. Below is the code I'm using. Here SkipFolderWorkflowSecurityReplication does not seem to work for me to skip copying the access controls (users).

    $Splat_NewWorkArea = @{
    TemplateName = $row.Template
    StorageArea = $row.StorageArea
    ProjectProperties = $WorkAreaProperties
    DoNotCopyDocuments = $true

    SkipFolderWorkflowSecurityReplication = $true
    }

    $WorkArea = New-PWRichProject @Splat_NewWorkArea

    • Sign in to reply
    • Cancel

    Top Replies

    • Kevin van Haaren
      Offline Kevin van Haaren Tue, Jul 13 2021 10:36 AM +1
      I don't think you can (currently). What I've done in the past is create the richproject then use either Remove-PWFolderSecurity or Reset-PWFolderSecurity to get rid of the existing security. I don't remember…
    • Kevin van Haaren
      Offline Kevin van Haaren Thu, Jul 15 2021 10:50 AM in reply to Bhanu Chauhan +1
      I'm not sure what you mean by "not effective in removing any folder/document ACL" is it flat out not working and not removing anything, or is it removing the security and causing it to revert to Inherited…
    • Kevin van Haaren
      0 Offline Kevin van Haaren Tue, Jul 13 2021 10:36 AM

      I don't think you can (currently). What I've done in the past is create the richproject then use either Remove-PWFolderSecurity or Reset-PWFolderSecurity to get rid of the existing security. I don't remember what the difference between the two cmdlets is (the help on them needs a lot of work).

      Help for each:

      NAME
          Remove-PWFolderSecurity
          
      SYNOPSIS
          
          
      SYNTAX
          Remove-PWFolderSecurity [-InputFolder] <ProjectWiseFolder[]> [-MemberType] <string> [[-MemberName] <string>] 
          [-DocumentSecurity <SwitchParameter>] [-FolderSecurity <SwitchParameter>] [-StateName <string>] [-WorkflowName 
          <string>] [<CommonParameters>]
          
          
      DESCRIPTION
          
      
      PARAMETERS
          -InputFolder <ProjectWiseFolder[]>
              
          -MemberType <string>
              
          -MemberName <string>
              
          -FolderSecurity <SwitchParameter>
              
          -DocumentSecurity <SwitchParameter>
              
          -WorkflowName <string>
              
          -StateName <string>
              
          <CommonParameters>
              This cmdlet supports the common parameters: Verbose, Debug,
              ErrorAction, ErrorVariable, WarningAction, WarningVariable,
              OutBuffer, PipelineVariable, and OutVariable. For more information, see 
              about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 
          
      REMARKS
          To see the examples, type: "get-help Remove-PWFolderSecurity -examples".
          For more information, type: "get-help Remove-PWFolderSecurity -detailed".
          For technical information, type: "get-help Remove-PWFolderSecurity -full".
      
      
      
      

      NAME
          Reset-PWFolderSecurity
          
      SYNOPSIS
          
          
      SYNTAX
          Reset-PWFolderSecurity [-InputFolder] <ProjectWiseFolder[]> -AllSecurity <SwitchParameter> [-IncludeWorkflows 
          <SwitchParameter>] [<CommonParameters>]
          
          Reset-PWFolderSecurity [-InputFolder] <ProjectWiseFolder[]> [-DocumentSecurity <SwitchParameter>] [-FolderSecurity 
          <SwitchParameter>] [-IncludeWorkflows <SwitchParameter>] [<CommonParameters>]
          
          
      DESCRIPTION
          
      
      PARAMETERS
          -InputFolder <ProjectWiseFolder[]>
              
          -AllSecurity <SwitchParameter>
              
          -FolderSecurity <SwitchParameter>
              
          -DocumentSecurity <SwitchParameter>
              
          -IncludeWorkflows <SwitchParameter>
              
          <CommonParameters>
              This cmdlet supports the common parameters: Verbose, Debug,
              ErrorAction, ErrorVariable, WarningAction, WarningVariable,
              OutBuffer, PipelineVariable, and OutVariable. For more information, see 
              about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 
          
      REMARKS
          To see the examples, type: "get-help Reset-PWFolderSecurity -examples".
          For more information, type: "get-help Reset-PWFolderSecurity -detailed".
          For technical information, type: "get-help Reset-PWFolderSecurity -full".
      
      
      
      

       

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Bhanu Chauhan
      0 Offline Bhanu Chauhan Wed, Jul 14 2021 2:04 AM in reply to Kevin van Haaren

      I tried both cmdlets, but they do not remove all access controls (users, userlists, groups) from my work area. 
      The access control permissions are discernably unchanged even after running both the scripts. The verbose transcipt claims to remove some document/folder security with the following warnings in each case.

      Remove-PWFolderSecurity -InputFolder "MyWorkArea\FolderLevel1\FolderLevel2\LastLevel" 
       -FolderSecurity -DocumentSecurity -MemberType Everyone -Verbose

      Remove-PWFolderSecurity : Failed to remove document security for "MyWorkArea\FolderLevel1\FolderLevel2...
      At line:1 char:1
      + Remove-PWFolderSecurity -InputFolder "MyWorkArea\Folder ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : NotSpecified: (Not found.:String) [Remove-PWFolderSecurity], Exception
      + FullyQualifiedErrorId : PWErrorID: 50000,PWPS_DAB.RemovePWFolderSecurity

      $AllFolders = Get-PWFolders -FolderPath "MyWorkArea" -PopulatePaths | Select-Object FullPath
      
      foreach($Folder in $AllFolders)
      {
      Reset-PWFolderSecurity -InputFolder $Folder -FolderSecurity -DocumentSecurity -IncludeWorkflows -Verbose
      }

      WARNING: No access control entries found for specified project.


      I do not want to inherit the access control permissions from the Template Work Area while creating a new rich project (work area). I intend to import separate Access Control Excel for that.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Kevin van Haaren
      0 Offline Kevin van Haaren Wed, Jul 14 2021 9:28 AM in reply to Bhanu Chauhan

      There has to be some access control list. There is no concept of "no access control", not having a defined access control list means inherit the access control from the folder above it.

      The way i've worked around this before is to apply an ACL that is just the administrators group (or a User List that is empty). If I remember correctly if I applied that to the template folder i used to create the new rich project it would be copied along and then i could apply the new access control after that part was done. Then nobody had access except people with "access control" turned off in their user settings.

       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Bhanu Chauhan
      0 Offline Bhanu Chauhan Thu, Jul 15 2021 2:57 AM in reply to Kevin van Haaren

      Yes, some administrator groups/userlists are expected to be there but for me, both the Remove-PWFolderSecurity and Reset-PWFolderSecurity are not effective in removing any folder/document ACL.

      I think having a template work area with only administrators group as ACL works in my case. It just limits from using existing projects as a template.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Kevin van Haaren
      0 Offline Kevin van Haaren Thu, Jul 15 2021 10:50 AM in reply to Bhanu Chauhan

      I'm not sure what you mean by "not effective in removing any folder/document ACL" is it flat out not working and not removing anything, or is it removing the security and causing it to revert to Inherited security.

      If it's the first theres either a bug in your script or in the cmdlet.

      If it's the second that's the way ProjectWise security works, folders with no security acl applied will inherit from the folder above.

      If you have a Rich Project with security applied that is getting copied and you want to remove that security until at some future date you can apply correct security then I recommend:

      • Create Rich Project
      • Remove all security
      • Apply new security of just the administrators group

      For that last step, once you remove security, updating the security after with:

      Update-PWFolderSecurity -InputFolder $PWFolder -MemberType 'g' -MemberName 'Administrators' -MemberAccess 'r,fr' -FolderSecurity -DocumentSecurity

      where $PWFolder is a Projectwise folder object of the RIch Project. should set security so only administrators can access the folder.

       

      • Cancel
      • Vote Up +1 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