Metalogix Content Matrix can generate PowerShell scripts to be used to migrate SharePoint content through the PowerShell command window. You can also use PowerShell to perform other actions, including:
·triggering a job in the Content Matrix Console to run
The Content Matrix PowerShell Console shortcut is added to the same Start Menu folder location where the to Metalogix Content Matrix Consoles are placed after installation. The same PowerShell console can be used for any edition, as long as the edition-specific snap-ins are used. You can also use a standard PowerShell console or PowerShell ISE.
Whenever a new PowerShell session is launched, the edition-specific snap-ins must be added before you can perform a Content Matrix action.
NOTES:
· If you have more than one edition of Content Matrix, only one edition can be run per PowerShell session.
·If Content Matrix settings is changed, in order to apply new settings all PowerShell sessions must be restarted.
To add the PowerShell cmdlets for the application framework:
1.Open a Powershell ISE or PowerShell console session.
2.Add the PowerShell snap-ins by pasting in the following text:
if ( $PsVersionTable.PSVersion.Major -lt 3 ) { Write-Host "Windows PowerShell Version 3.0 or later needs to be installed in order to run Content Matrix PowerShell scripts."; exit; }
if ( (Get-PSSnapin -Name Metalogix.System.Commands -ErrorAction SilentlyContinue) -eq $null ) { add-pssnapin Metalogix.System.Commands | out-null }
if ( (Get-PSSnapin -Name Metalogix.SharePoint.Commands -ErrorAction SilentlyContinue) -eq $null ) { add-pssnapin Metalogix.SharePoint.Commands | out-null }
if ( (Get-PSSnapin -Name Metalogix.eRoom.Commands -ErrorAction SilentlyContinue) -eq $null ) { add-pssnapin Metalogix.eRoom.Commands | out-null }
if (Get-Command Set-MetalogixJobPrerequisites -ErrorAction SilentlyContinue){ Set-MetalogixJobPrerequisites -Value "Content Matrix Console - eRoom Edition" }
You can perform Pre-Migration Checks, Nested Contents Reports, and Nested Contents URL Length Reports through the PowerShell command window.
In order to create a PowerShell script for a Nested Contents Report or a Pre-Migration Check, Nested Contents URL Report, a report item must first exist in the Job List section.
To create a PowerShell script for Nested Content Reports and Pre-Migration Checks:
1.In the Job List section, select the report(s) want to run in PowerShell.
2.Either:
§Click the [Generate PowerShell Script] button in the Job List menu options
OR
§Right-click and choose Generate PowerShell Script.
3.Choose the appropriate option from the sub-menu to specify the security method that will be used when generating the PowerShell script . Use the information in the following table for guidance.
If you want to generate a PowerShell script |
Choose |
---|---|
that can be used only by the currently logged in User Account on the machine it is generated on |
For Current User and Machine. NOTE: Any PowerShell scripts that are generated for scheduling through this option can only be run by the logged in user on the machine they were generated on. |
that can be used by any User account on the machine it is generated on |
For Current Machine. |
that can be used by any User account on any machine that has the certificate that is specified when the script is created |
For Certificate. When you save the PowerShell script using this method you will be prompted to select a security certificate that exist on that machine. The selected certificate will be required on any system that attempts to run the script at a later date.
|
Once the applicable option is selected, Metalogix Content Matrix Console will generate a PowerShell script for the selected report, which will be written to a Notepad file. If multiple reports are selected, they will all be included in that single file.
3.To save the file as a PowerShell script:
a)In the Job List section toolbar, choose File > Save As....
b)In the Save As dialog box, navigate to the directory in which the script file is to be saved.
c)Click the Save as type drop-down menu and select All Files.
d)Enter a name for the script and append the .ps1 file extension to the file name to save it as a PowerShell script.
To run the PowerShell script:
NOTES:
· If you have more than one edition of Content Matrix, only one edition can be run per PowerShell session.
·If Content Matrix settings is changed, in order to apply new settings all PowerShell sessions must be restarted.
To add the PowerShell cmdlets for the application framework:
1.Open a Powershell ISE or PowerShell console session.
2.Add the PowerShell snap-ins by pasting in the following text:
if ( $PsVersionTable.PSVersion.Major -lt 3 ) { Write-Host "Windows PowerShell Version 3.0 or later needs to be installed in order to run Content Matrix PowerShell scripts."; exit; }
if ( (Get-PSSnapin -Name Metalogix.System.Commands -ErrorAction SilentlyContinue) -eq $null ) { add-pssnapin Metalogix.System.Commands | out-null }
if ( (Get-PSSnapin -Name Metalogix.SharePoint.Commands -ErrorAction SilentlyContinue) -eq $null ) { add-pssnapin Metalogix.SharePoint.Commands | out-null }
if ( (Get-PSSnapin -Name Metalogix.eRoom.Commands -ErrorAction SilentlyContinue) -eq $null ) { add-pssnapin Metalogix.eRoom.Commands | out-null }
if (Get-Command Set-MetalogixJobPrerequisites -ErrorAction SilentlyContinue){ Set-MetalogixJobPrerequisites -Value "Content Matrix Console - eRoom Edition" }
2.Change the active directory to the file path in which the script file is saved by using the change directory command ("cd <File path>") and then enter ".\" followed by the script name. For example, if your script is named "ResourceScript.ps1", you would enter .\ResourceScript.ps1 to run the script.
NOTE: If the active directory is different than the directory in which the script file is saved, enter the full file path of the script file relative to your current directory, and then the script file name. For example, if your prompt is at "C:\", your script is named "ResourceScript.ps1", and the script is saved on the desktop, you would enter C:\Users\<User>\Desktop\ResourceScript.ps1 to run the script.
In some cases, the Execution Policy may prevent you from executing a PowerShell script. In this case, you will likely see the following message: [Script].ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details. In this case, run the following command: set-executionpolicy RemoteSigned. This will change the existing script policy to allow you to run these scripts in the specified location. However, it is advised that you check with your System Administrators before doing so to ensure that no Company Policies are being broken by this action.
All Pre-Migration Checks, Nested Contents Reports and Nested Contents URL Reports included in the PowerShell script will run, and any warnings or errors that are encountered while the script runs will be displayed in the PowerShell window.
Metalogix Content Matrix can generate PowerShell script for you, for any migration action that is available through it. The below cmdlets are used in the generated PowerShell script, but can also be used to write your own script, should you desire to do so. For more information on each cmdlet, simply type get-help [cmdlet]. For example, if you want more information on Copy-MLSharePointList cmdlet you would enter get-help Copy-MLSharePointList, followed by the Enter (return) key.
Below is a list of the available cmdlets (and their parameters), broken up into the available commands for each snap-in.
© ALL RIGHTS RESERVED. Términos de uso Privacidad Cookie Preference Center