About

.

7 comments

  1. Hey Nik, just used the script that you posted – List All SharePoint Site Request Access Emails In A Web Application, super helpful. Just wanted to say, on behalf of the internet, thank you.

    Cheers,

    Gene Perry

  2. Hi Nik,

    I found your excellent script for saving docs, list, metadata to the file system, but had one question.
    http://www.nikcraik.ca/sharepoint-powershell-script-to-extract-all-documents-and-their-versions/
    Your varialbles,
    # $ServerFileLocation: Where the source file is located on the web
    # $DownloadPath: The destination to download to

    function HTTPDownloadFile($ServerFileLocation, $DownloadPath)
    {
    $webclient = New-Object System.Net.WebClient
    $webClient.UseDefaultCredentials = $true
    $webclient.DownloadFile($ServerFileLocation,$DownloadPath)

    I”m not seeing how you dynamically assign $serverfilelocation, it would seem this will change as the site is iterated thru for content?

    Thanks,
    Art

    1. Hi Art,

      Thanks for the comment, I’m glad you found the script useful! I’m reaching back in my memory as I haven’t looked at this in a while, but here goes.

      To use the script, all you need to do is change the $site variable to the address of your SharePoint site and the $destination variable to where to download the material to, and it’ll download everything from that site. Changing the $ServerFileLocation variable isn’t necessary.

      Details on this:

      The HTTPDownloadFile function doesn’t need to be set manually, it’s actually called by the GetFileVersions function later on – this is because I couldn’t find a way to easily download previous versions of a file, but it IS possible to download them through a regular HTTP connection, just like using a web browser. GetFileVersions is called in the DownloadDocLib function, which is used to download an entire doc library, versions and all (thanks to GetFileVersions). The DownloadSite function is the main function that downloads all the documents + versions from an entire SharePoint site.

  3. Nik:
    Is there an associated script to import the CSV files output using the “Extract All Documents and their Versions” script?

Leave a Reply to Nik Cancel reply

Your email address will not be published. Required fields are marked *