New-SPWordConversionJob

Creates a new conversion job to convert one or more documents from one format to another.

New-SPWordConversionJob -InputList <SPListPipeBind> -OutputList <SPListPipeBind> -OutputFormat <SaveFormat> [-OutputSaveBehavior [<SaveBehavior>]] [-CompatibilityMode [<CompatibilityMode>]] [-AddThumbnail [<SwitchParameter>]] [-UpdateFields [<SwitchParameter>]] [-EmbedFonts [<SwitchParameter>]] [-MarkupView [<MarkupTypes>]] [-RevisionState [<RevisionState>]] [-SubsetEmbeddedFonts [<SwitchParameter>]] [-Wait [<SwitchParameter>]] [-AssignmentCollection [<SPAssignmentCollection>]]

New-SPWordConversionJob -InputFile <SPFilePipeBind> -OutputFile <String> -OutputFormat <SaveFormat> [-OutputSaveBehavior [<SaveBehavior>]] [-CompatibilityMode [<CompatibilityMode>]] [-AddThumbnail [<SwitchParameter>]] [-UpdateFields [<SwitchParameter>]] [-EmbedFonts [<SwitchParameter>]] [-MarkupView [<MarkupTypes>]] [-RevisionState [<RevisionState>]] [-SubsetEmbeddedFonts [<SwitchParameter>]] [-Wait [<SwitchParameter>]] [-AssignmentCollection [<SPAssignmentCollection>]]

New-SPWordConversionJob -InputFolder <SPFolderPipeBind> -OutputFolder <SPFolderPipeBind> [-Recurse [<SwitchParameter>]] -OutputFormat <SaveFormat> [-OutputSaveBehavior [<SaveBehavior>]] [-CompatibilityMode [<CompatibilityMode>]] [-AddThumbnail [<SwitchParameter>]] [-UpdateFields [<SwitchParameter>]] [-EmbedFonts [<SwitchParameter>]] [-MarkupView [<MarkupTypes>]] [-RevisionState [<RevisionState>]] [-SubsetEmbeddedFonts [<SwitchParameter>]] [-Wait [<SwitchParameter>]] [-AssignmentCollection [<SPAssignmentCollection>]]

Parameters

1

ParameterRequiredTypeDescription
InputListTrueSPListPipeBind

The input library whose items will be converted and copied to the output list.

The value must be a valid URL in the form http://server_name

OutputListTrueSPListPipeBind

The output library where the converted items will be stored.

The value must be a valid URL in the form http://server_name

OutputFormatTrueSaveFormat

Specifies the Save format for this conversion job. The extension associated with the Save format specified here is appended to the output file if the extension is not already present. For example, when converting to PDF, a document with the output file name http://contoso/output/output.pdf would remain unchanged; a document with the output file name http://contoso/output/output.docx would be changed to http://contoso/output/output.docx.pdf.

OutputSaveBehaviorFalseSaveBehavior

Specifies the behavior that should be applied when saving converted files to existing file names.

CompatibilityModeFalseCompatibilityMode

Specifies the appropriate compatibility mode for the output file. If the file is not an Open XML File format document, this setting is ignored. MaintainCurrentSetting specifies that files maintain their compatibility mode as follows:

• Binary files and files in Word 97-2003 compatibility mode stay in that mode.

• Word 2007 documents or documents in Word 2007 compatibility mode stay in that mode.

• Documents upgraded to Word 2010 stay upgraded.

AddThumbnailFalseSwitchParameter

Indicates whether the document is saved with an added thumbnail. Setting this property has the same effect as checking Save Thumbnail in the Save As dialog in Word.

UpdateFieldsFalseSwitchParameter

Indicates whether any fields in the document are automatically updated when the document is opened.

EmbedFontsFalseSwitchParameter

Indicates whether fonts used within the document are obfuscated and saved within the output. This setting uses the same obfuscation mechanisms as Word.

MarkupViewFalseMarkupTypes

Specifies the type(s) of markup that should be shown in the document.The possible values for this property correspond to the options available on the ribbon (Tracking group, Show Markup dropdown). The default value for this property is @(Comments, Ink, Text, Formatting), which means all types of markup are shown.

RevisionStateFalseRevisionState

Specifies the visibility of revisions in the document.

SubsetEmbeddedFontsFalseSwitchParameter

Indicates whether to restrict the characters that are included in the embedded font to only those characters that are required by the current document.

WaitFalseSwitchParameter

If specified then the cmdlet will block until the conversion completes.

AssignmentCollectionFalseSPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

2

ParameterRequiredTypeDescription
InputFileTrueSPFilePipeBind

The input file that will be converted and copied to the output file.

The value must be a valid URL in the form http://server_name

OutputFileTrueString

The output file where the converted item will be copied to.

The value must be a valid URL in the form http://server_name

OutputFormatTrueSaveFormat

Specifies the Save format for this conversion job. The extension associated with the Save format specified here is appended to the output file if the extension is not already present. For example, when converting to PDF, a document with the output file name http://contoso/output/output.pdf would remain unchanged; a document with the output file name http://contoso/output/output.docx would be changed to http://contoso/output/output.docx.pdf.

OutputSaveBehaviorFalseSaveBehavior

Specifies the behavior that should be applied when saving converted files to existing file names.

CompatibilityModeFalseCompatibilityMode

Specifies the appropriate compatibility mode for the output file. If the file is not an Open XML File format document, this setting is ignored. MaintainCurrentSetting specifies that files maintain their compatibility mode as follows:

• Binary files and files in Word 97-2003 compatibility mode stay in that mode.

• Word 2007 documents or documents in Word 2007 compatibility mode stay in that mode.

• Documents upgraded to Word 2010 stay upgraded.

AddThumbnailFalseSwitchParameter

Indicates whether the document is saved with an added thumbnail. Setting this property has the same effect as checking Save Thumbnail in the Save As dialog in Word.

UpdateFieldsFalseSwitchParameter

Indicates whether any fields in the document are automatically updated when the document is opened.

EmbedFontsFalseSwitchParameter

Indicates whether fonts used within the document are obfuscated and saved within the output. This setting uses the same obfuscation mechanisms as Word.

MarkupViewFalseMarkupTypes

Specifies the type(s) of markup that should be shown in the document.The possible values for this property correspond to the options available on the ribbon (Tracking group, Show Markup dropdown). The default value for this property is @(Comments, Ink, Text, Formatting), which means all types of markup are shown.

RevisionStateFalseRevisionState

Specifies the visibility of revisions in the document.

SubsetEmbeddedFontsFalseSwitchParameter

Indicates whether to restrict the characters that are included in the embedded font to only those characters that are required by the current document.

WaitFalseSwitchParameter

If specified then the cmdlet will block until the conversion completes.

AssignmentCollectionFalseSPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

3

ParameterRequiredTypeDescription
InputFolderTrueSPFolderPipeBind

The input library folder whose items will be converted and copied to the output list.

The value must be a valid URL in the form http://server_name

OutputFolderTrueSPFolderPipeBind

The output library folder where the converted items will be stored.

The value must be a valid URL in the form http://server_name

RecurseFalseSwitchParameter

Recursively convert all items in the folder's sub-folders.

OutputFormatTrueSaveFormat

Specifies the Save format for this conversion job. The extension associated with the Save format specified here is appended to the output file if the extension is not already present. For example, when converting to PDF, a document with the output file name http://contoso/output/output.pdf would remain unchanged; a document with the output file name http://contoso/output/output.docx would be changed to http://contoso/output/output.docx.pdf.

OutputSaveBehaviorFalseSaveBehavior

Specifies the behavior that should be applied when saving converted files to existing file names.

CompatibilityModeFalseCompatibilityMode

Specifies the appropriate compatibility mode for the output file. If the file is not an Open XML File format document, this setting is ignored. MaintainCurrentSetting specifies that files maintain their compatibility mode as follows:

• Binary files and files in Word 97-2003 compatibility mode stay in that mode.

• Word 2007 documents or documents in Word 2007 compatibility mode stay in that mode.

• Documents upgraded to Word 2010 stay upgraded.

AddThumbnailFalseSwitchParameter

Indicates whether the document is saved with an added thumbnail. Setting this property has the same effect as checking Save Thumbnail in the Save As dialog in Word.

UpdateFieldsFalseSwitchParameter

Indicates whether any fields in the document are automatically updated when the document is opened.

EmbedFontsFalseSwitchParameter

Indicates whether fonts used within the document are obfuscated and saved within the output. This setting uses the same obfuscation mechanisms as Word.

MarkupViewFalseMarkupTypes

Specifies the type(s) of markup that should be shown in the document.The possible values for this property correspond to the options available on the ribbon (Tracking group, Show Markup dropdown). The default value for this property is @(Comments, Ink, Text, Formatting), which means all types of markup are shown.

RevisionStateFalseRevisionState

Specifies the visibility of revisions in the document.

SubsetEmbeddedFontsFalseSwitchParameter

Indicates whether to restrict the characters that are included in the embedded font to only those characters that are required by the current document.

WaitFalseSwitchParameter

If specified then the cmdlet will block until the conversion completes.

AssignmentCollectionFalseSPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

Creates a new conversion job to convert one or more documents from one format to another. This cmdlet leverages the Word Automation Service to do the conversion. Using Word Automation Services, you can convert from Open XML WordprocessingML to other document formats. For example, you may want to convert many documents to the PDF format and spool them to a printer or send them by e-mail to your customers. Or, you can convert from other document formats (such as HTML or Word 97-2003 binary documents) to Open XML word-processing documents. By default the timer job that does the conversions is schedule to run every 15 minutes - you can change this by editing the "Word Automation Services Timer Job" timer job (or manually tell it to run immediately). If you specified the Wait parameter then it may take up to 15 minutes to respond if you have not changed this default.

Copyright 2016 Falchion Consulting, LLC

> For more information on this cmdlet and others:

> http://blog.falchionconsulting.com/

> Use of this cmdlet is at your own risk.

> Gary Lapointe assumes no liability.

Examples

------------------EXAMPLE 1-----------------------

PS C:\> New-SPWordConversionJob -InputList "http://server_name/WordDocs" -OutputList "http://server_name/PDFDocs" -OutputFormt PDF -OutputSaveBehavior AppendIfPossible -Wait

This example converts the documents located in http://server_name/WordDocs and stores the converted items in http://server_name/PDFDocs.

------------------EXAMPLE 2-----------------------

PS C:\> New-SPWordConversionJob -InputFile "http://server_name/WordDocs/report.docx" -OutputFile "http://server_name/PDFDocs/report.pdf" -OutputFormt PDF -OutputSaveBehavior AppendIfPossible -Wait

This example converts the document located in http://server_name/WordDocs/report.docx and stores the converted item as http://server_name/PDFDocs/report.pdf.

------------------EXAMPLE 3-----------------------

PS C:\> New-SPWordConversionJob -InputFolder "http://server_name/WordDocs/Reports" -OutputFolder "http://server_name/PDFDocs/Reports" -OutputFormt PDF -OutputSaveBehavior AppendIfPossible -Wait

This example converts the document located in http://server_name/WordDocs/Reports and stores the converted items in http://server_name/PDFDocs/Reports.