#PowerShell, #PowerWiseScripting, #ProjectWise, PWPS_DAB

How To: Update ProjectWise Folder Security

The following is an example script for updating the access control setting for all sub-folders within a project.

Update the values for MemberType, MemberName, MemberAccess, and ParentFolder to meet your needs.

# Access control settings
# MemberType can be User, Group, UserList, Everyone
$MemberType = 'UserList'
# Name of user/group/userlist. Can be excluded if MemberType = Everyone
$MemberName = 'Read_Only'
# See the help for Update-PWFolderSecurity possible MemberAccess values.
$MemberAccess = 'r', 'w'
# Parent folder to force all subfolder to inherit from.
$ParentFolder = 'test\Parent_123456'

<# The following will return the ProjectWise folder objects
for the parent folder and all sub-folders. #>
$PWFolders = Get-PWFolders -FolderPath $ParentFolder -Slow -Verbose

<# The following will remove the parent folder from the array.
Want to ensure the Parent folder's access control is not reset. #>
$PWFolders = $PWFolders | Where-Object { $_.FullPath -NE $ParentFolder }

# The following will update the access control for all remaining sub-folders.
# Using splatting for better readability.
$UpdateSettings = @{
InputFolder = $PWFolders
MemberType = $MemberType
MemberAccess = $MemberAccess
MemberName = $MemberName
}

<# See the help for full features of this cmdlet.
It is important to understand how this cmdlet works as you may remove yourself
from being able to access or see the folder.
#>
# Get-Help Update-PWFolderSecurity -Full
Update-PWFolderSecurity @UpdateSettings -FolderSecurity -DocumentSecurity -IncludeInheritance -Verbose

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s