Extract Documents to Folder based on Managed Metadata Column - SharePoint

  How to Extract documents from Multiple Document libraries in to Folders. Each has a Managed Metadata Column with Sub Terms. I have created three Functions to  Download Document Create Folder Main Method Addition to above, script will log the Document URL and destination Folder Path in .log file Create Folder   Function   Create-Folder {      param  ( $folderPath )      if  (!( Test-Path  -path  $folderPath ))     {          New-Item   $folderPath  -type directory     } } Download Document ( this is stolen from Stackoverflow 😁 ) Function   Download-Document {      param ( $web ,  $folderPath ,  $docItem )       #File Download Snippet Reffered From : https://stackoverflow.com/questions/43350575/how-to-use-powershell-to-download-files-from-sharepoint        $File  =  $web .GetFile ( $docItem .Url )          $Binary  =  $File .OpenBinary ()          $detinationPath  =  $folderPath  +  "\"  +  $File .Name ;          $Stream  =  New-Object  System.IO.FileStream( $detinationPath

How to Publish Nintex Forms through PowerShell

Publishing Nintex form through PowerShell, was a challenge for me during last few weeks. After consulting Nintex team they have provided many valuable information related to the same topic.

I will go through each and every information which I have gathered. Finally I was able to publish the Nintex Form through PowerShell

Initially Nintex team has provided details to the in built web service for publishing a workflow.

Above link explains all available methods within the service 

·         Endpoint URL
·         DeleteForm
·         GetFormXml
·         PublishFormXml
The moment I tried to access the web service via browser, I got an error saying "End Point Not Found".

But later I found a valuable post on Nintex community by mattbriggs who has overcome same issue through Visual Studio Solution in his blog post Named asPublish a Form Using the Nintex Forms On Prem 2013 Web Service“.

Unfortunately in my corporate environment as a policy we are not publishing any custom build WSP solutions in to our farm.
In the Same page sonisick has provided an amazing solution to implement the same in PowerShell.
I was able to use same functions as it was and implemented a new function to get XML Form downloaded to a custom folder.
All credits should go to sonisick and mattbriggs I’m publishing their methods along with the additional form download functionality which I was implemented using their references.
PowerShell Code Function Definitions
If I say reused method, that means it was copied from reply of sonisick from the above specified blog post
Function Name
If not exists, Create a new folder to hold downloaded XML file
Decode serialized JSON output in to XML string
Publish the XML form in to destination SharePoint List (reused same method from Sonisick’s reply )
Reused method
Reused Method
Reused Method
This is modified method from above Post to get SPList object from List name (instead of internal name of the list)
Used to check XML file already generated or not for same list
Implemented to download the XML File from the List using GetFormXML web service method.
Reused Method – Get-NintexFormXML method included to get XML File instead of hardcoded path

Again Please Note Below Solution I have created as part of Creating Sub Sites and Publishing their Nintex Forms via PowerShell. Some of the parameters might not required for you to use within this Script

Creating Sub Sites and Setting Master Page through PowerShell, I have discussed on my previous Post

To Publish the Nintex Form you can use the function as follows Download Entire Script from here

Publish-NintexForm -templateSiteURL $sourceSiteURL -destinationSiteURL $subSiteUrl -listNameToPublishForm $listNameToPoblushForm -FolderPath $xmlFileFolderPath -initiatorCredentials $Credentials

Download Entire Script from here

Again Special Thanks should go to sonisick and mattbriggs  
Hope this might help someone.


Pre-Upgrade Check List

Download Our Free SharePoint Pre-Upgrade Check List

* indicates required

Vintage Clan

Popular posts from this blog

System.Data.SqlClient.SqlException (0x80131904): The EXECUTE permission - User Profile Issue

How to Create Host Header to SharePoint Web Application

SharePoint 2013 Access Denied in Site Collections in Web Application