locked
PowerShell cannot access certain document versions in SharePoint 2007 RRS feed

  • Question

  • Hello,

    I have a PowerShell script that deletes versions of documents from SharePoint 2007 libraries. It works correctly with most libraries; however I've run into an issue where PowerShell cannot access any versions where the "Modified By" column lists the name in "domain/username" format rather than listing the display name in link format to the user's profile page.

    Example screenshot below: in this example, PowerShell only sees the most recent version (9.0) but not the rest.

    Does anyone know why PowerShell / SharePoint API is unable to access these versions? Or why the usernames do not appear in the "hyperlink" format?

    Thank you!

    Kevin Worthington

    Monday, November 2, 2015 5:24 PM

All replies

  • Does the account you are using for the PowerShell have permissions to see the versions in that site/library/document?  Can you log into SharePoint using that same account, browse to that document and display the versions?

    Administrator accounts in general do not have permissions to see all SharePoint content.

     

     

    Mike Smith TechTrainingNotes.blogspot.com
    Books: SharePoint 2007 2010 Customization for the Site Owner, SharePoint 2010 Security for the Site Owner

    Monday, November 2, 2015 5:52 PM
  • Hi Mike,

    Yes, I have tested using the farm account as well as my own. Both have full access to the entire web application and are local admins on the server. I am also site collection administrator on the site. The library inherits permissions from the site collection. So I don't think it's a permissions issue with my account or the farm account.

    I can see all of the content, as shown in my screenshot above. However, the SharePoint object model (via PowerShell) cannot find the other versions (for example versions 1 through 8), it only sees the current one (version 9).

    I replaced the actual usernames with my own for the above example. Here's another one:

    In this case, version 2.0 is accessible via PowerShell, but version 1.0 is not.

    A coworker of mine suggested that this might be due to the site being migrated from WSS 2.0 into this WSS 3.0 site.

    Monday, November 2, 2015 7:26 PM