#PowerShell, #PowerWiseScripting, #ProjectWise, PWPS_DAB

How To: Report on Missing Files Within ProjectWise Using PowerShell

Occasionally, within a ProjectWise datasource, files can go missing on a server (file storage area) or files are not deleted properly from a dms folder on a server causing an error when attempting to delete a ProjectWise folder.

With the release of PWPS_DAB module version 1.7.3.0, we have improved the existing Get-PWStorageAreaReport cmdlet to allow for skipping certain tasks to expedite the reporting process. We also have a new cmdlet, Get-PWMissingStorageAreaFiles, which scans a project or an entire datasource and reports on any missing files.

NOTE: You will need to have access to the file storage area(s) in order to run either of these cmdlets. If you do not, you may receive incorrect data.

First things first. Take a look at the help for the Get-PWStorageAreaReport and Get-PWMissingStorageAreaFiles cmdlets to familiarize yourself with the available parameters, etc.

Get-Help Get-PWStorageAreaReport -Full
Get-Help Get-PWMissingStorageAreaFiles -Full

The Get-PWStorageAreaReport cmdlet generates a report listing only the discrepancies found within the folder path, storage area, or entire datasource depending on the parameters supplied.  We have added two new parameters which allow for certain time consuming tasks to be skipped, thus helping to expedite the processing. Both are switch parameters, so when included the corresponding task will be skipped.

  • SkipFileSizeCheck
    • When included, skips the file size check.
  • SkipOrphanedFileCheck
    • When included, skips the check for orphaned files.

The following are a couple examples on using the Get-PWStorageAreaReport cmdlet with the new switch parameters.

 #The following will create a storage area report for an entire datasource. Skipping the file size check.
Get-PWStorageAreaReport -OutputFolder 'D:\Reports' -SkipFileSizeCheck -Verbose

#The following will create a storage area report for an entire datasource. Skipping the orphaned file check.
Get-PWStorageAreaReport -OutputFolder 'D:\Reports' -SkipOrphanCheck -Verbose

The following table is an example of the report output.

2018-10-24_5-22-172_left


The Get-PWMissingStorageAreaFiles cmdlet returns an array of ProjectWise document objects for any discrepancies found within the folder path supplied or the entire datasource. This cmdlet does not have any required parameters, but does have two optional parameters we will take a look at.

  • FolderPath
    • The folder path of a ProjectWise folder to report on.
  • UseAdminPaths
    • When UseAdminPaths in included, the UNC path to the files will be used.
    • Use this option when running this cmdlet remotely.
<# The following will return ProjectWise document objects for any 
discrepancies found within the entire datasource. #>
$MissingDocs = Get-PWMissingStorageAreaFiles -UseAdminPaths -Verbose

<# The following will return ProjectWise document objects for any 
discrepancies found within the specified project. #>
$MissingDocs = Get-PWMissingStorageAreaFiles -FolderPath 'Projects\123456 - MyNewProject\' -UseAdminPaths -Verbose

The following is a sample output for this cmdlet. Notice the $MissingDocs variable contains an array of 6 ProjectWise document objects.

2018-10-24_5-45-33

Experiment with it and have fun.

Hopefully, you find this useful. Please let me know if you have any questions or comments.

2 thoughts on “How To: Report on Missing Files Within ProjectWise Using PowerShell”

  1. I seem to be getting false positives when it comes to files in the storage area with versions. For example, files in ver00000 folders will show as orphaned when they are not.

    Like

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.