This is a new post for a comment I left on the PowerShell Module Request post, as this is not so much a request as a question about if this is intended behavior of the cmdlet:If a user owns a folder, I’m not able to delete the user via Remove-PWUser. I get the below error message:remove-pwuser : Error deleting User.PW Error ID#: 58012PW Error Message: Error deleting user by number.PW Error Detail: User is an owner of documents. A user who owns documents in the systemcan not be removed. Remove the documents first.At line:1 char:1+ remove-pwuser -UserName k+ ~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : NotSpecified: (:) [Remove-PWUser], PWPSException+ FullyQualifiedErrorId : Error deletingUser.PW Error ID#: 58012PW Error Message: Error deleting user by number.PW Error Detail: User is an owner of documents. A user who owns documents in the system can not be removed. Remove the documents first.,Bentley.ProjectWise.PowerShell.Commands.RemovePWUserIf a user deleted via Remove-PWUser is the last person to have modified a folder (for example, renamed it), in ProjectWise Explorer if you have the preview pane turned on and select the folder it throws a "Last Error  Not found." error message and the Folder Preview Pane tab is blank. The Properties’ Statistics tab for the folder show the updated by as blank.If I rename the folder, the error message goes away, the folder preview pane tab populates, and the Properties’ Statistics tab shows the last updated by as my username.Also, if a user is deleted via Remove-PWUser their metadata for documents (i.e. created by/updated by/file updated by) is blank in ProjectWise Explorer and the documents' property menus.If I delete a user via ProjectWise Administrator, their metadata for documents is replaced by my username.
Is this how Remove-PWUser is intended to work?
Hey, Emily. Sorry, this had slipped through the cracks. I can't really speak to PWPS, but Brian just added Remove-PWUserByMatch to PWPS_DAB v.220.127.116.11. We recommend running in 64-bit so that PWPS can't be loaded and thus lead to confusion. Remove-PWUserByMatch allows you to specify a new user to take over ownership of the objects the deleted user owns. BTW, the actual user name is recorded in the audit trail so that action history integrity is maintained even if a user is deleted.
Answer Verified By: Emily Miller
Dave, thanks. I'll give that a try.