cancel
Showing results for 
Search instead for 
Did you mean: 
ravichaturvedi
Nintex Newbie

Powershell Script to get the mappings between SharePoint content db and Nintex workflow

Hello Everyone,

 

I want a Powershell script to get the list of mappings between SharePoint content DB and Nintex workflow DB.

 

Regards,

Ravi

Labels: (1)
0 Kudos
Reply
1 Reply
Nintex Employee
Nintex Employee

Re: Powershell Script to get the mappings between SharePoint content db and Nintex workflow

Hi

Input your Nintex configuration database connection string and the name of your SharePoint database and run.

$Datatable = New-Object System.Data.DataTable 

    $Connection = New-Object System.Data.SQLClient.SQLConnection 

    $Connection.ConnectionString = "Data Source=DatabaseServer;Initial Catalog=NintexConfigDatabase;Integrated Security=True" # REPLACE CONNECTION STRING 

    $Connection.Open() 

    $Command = New-Object System.Data.SQLClient.SQLCommand 

    $Command.Connection = $Connection 

    $Command.CommandText = "Select Distinct D.DatabaseName,O.Name
From dbo.ContentDbMapping CM
INNER JOIN dbo.Databases D
ON CM.NWContentDbId = D.DatabaseID
INNER JOIN [SharePoint_Config].[dbo].[SiteMap] SP
ON  CM.SPContentDbId = SP.DatabaseId
INNER JOIN [SharePoint_Config].[dbo].[Objects] O 
ON O.Id=SP.DatabaseId" #REPLACE SharePoint_Config with your sharepoint database name

    $Reader = $Command.ExecuteReader() 

    $Datatable.Load($Reader) 

    $Connection.Close() 

return $Datatable 
0 Kudos
Reply