Important Powershell commands for configuring Office webs apps in SharePoint 2013

Office-Web-Apps-Server-2013---die-neue-Architektur

 

1.New-OfficeWebAppsFarm –> This command is used to create a new Office Web Apps Server farm on the local computer.

The New-OfficeWebAppsFarm cmdlet creates a new Office Web Apps Server farm on the local computer. You have to run this cmdlet on the first server in the Office Web Apps Server farm and then add more servers to the farm by using the New-OfficeWebAppsMachine cmdlet.

Syntax:

New-OfficeWebAppsFarm -InternalUrl “https://server.corp.contoso.com” -ExternalUrl “https://server.external.contoso.com” -EditingEnabled:$true -SSLOffloaded

This example creates an Office Web Apps Server farm on the local server that has editing enabled for Office Web Apps. The farm is configured for load balancing by enablingSSLOffloaded, which automatically enables AllowHttp. If you are not using a load balancer, make sure that you set Certificate Name.

Syntax using the certificate name:

New-OfficeWebAppsFarm -InternalUrl “https://server.corp.contoso.com” –CertificateName “Web OWA” -EditingEnabled

2. New-OfficeWebAppsMachine –> The New-OfficeWebAppsMachine cmdlet adds the current server to an existing Office Web Apps Server farm and optionally sets one or more roles on the new server.

Syntax:

New-OfficeWebAppsMachine -MachineToJoin server1.contoso.com

The “MachineToJoin” switch takes care of adding the new machine to the Office Web apps farm

3. Remove-OfficeWebAppsMachine –>   This command removes the current server from the Office Web Apps Server farm. As part of this process, the cmdlet removes the web applications and shuts down the services that are related to Office Web Apps Server. This command can be used during scenarios where you’re planning to patch the  current Office web apps server. Do remember that you’re supposed to remove the OWA server which you’re planning to patch from the OWA farm and once you’re done patching you have to add it back.

Note: This is applicable only when you have OWA running as a farm with many servers on it .

4. New-SPWOPIBinding –> This command associates file name extensions or applications to actions on the current SharePoint farm where this cmdlet is run. Each binding allows you to use the WOPI application to view or edit files in your SharePoint library. For example, when a user sees a Word document in a SharePoint document list, the SharePoint list will display the available options to view or edit the document based on the actions that are bound to Word on that SharePoint farm.

Syntax:

New-SPWOPIBinding -ServerName “Server.corp.Contoso.com” :  This example creates bindings for all the applications and file name extensions that the WOPI application supports on the current SharePoint farm where this cmdlet is run.

New-SPWOPIBinding -ServerName “Server.corp.Contoso.com” -Application “Excel” :  This command associates Excel with all the actions that the WOPI application supports for Excel on the current SharePoint farm where this cmdlet is run.

5. Remove-SPWOPIBinding –> This command is used to remove all the bindings for applications, file name extensions, and their associated actions on the current SharePoint farm where this cmdlet is run

Syntax:

Remove-SPWOPIBinding -All:$true –> This example removes all bindings on the current SharePoint farm where this cmdlet is run.

Remove-SPWOPIBinding -Application “Excel” –> for excel alone.

Get-SPWOPIBinding -Action “MobileView” | Remove-SPWOPIBinding –> This example removes all bindings for Office Mobile Web Apps on the current SharePoint farm where this cmdlet is run.

6. Get-SPWOPIBinding –> This command returns a list of bindings that were created by using New-SPWOPIBinding on the current SharePoint farm where this cmdlet is run

Syntax:

Get-SPWOPIBinding -Server “Server.corp.Contoso.com” :  This example returns a list of bindings that were created on the current SharePoint farm where this cmdlet is run for the WOPI application “Server.corp.Contoso.com.”  The WOPI application may be the server that runs Office Web Apps Server.

Get-SPWOPIZone | Get-SPWOPIBinding :  This example returns a list of bindings that were created on the current SharePoint farm where this cmdlet is run for the zone configured for the WOPI application.

7. Set-SPWOPIBinding — > This command Updates the default click action for an application or file name extension binding.  The Set-SPWOPIBinding cmdlet updates the default click action for an application or file name extension binding. For example, you can set the default click action for viewing a Word document in a SharePoint library. To do this, you set the default action to true for the “view”-“Word” bindings

Syntax:

Get-SPWOPIBinding -Action “view” -Application “Word”| Set-SPWOPIBinding -DefaultAction –> This example sets the default click action to view for a Word document in a SharePoint library. You can verify that the default click action is set to view for Word by running the cmdlet Get-SPWOPIBinding –Action “view” –Application “Word”. The IsDefaultAction value is set to “True.”

8. New-SPWOPISuppressionSetting –> This command turns off Office Web Apps for the action, file name extension, or programmatic identifier that you’ve specified on the current SharePoint farm.

Syntax:

New-SPWOPISuppressionSetting -Extension “XLSX” -Action “view” &

New-SPWOPISuppressionSetting -Extension “XLS” -Action “view”

This example turns off the ability of a user to use Office Web Apps to view Excel workbooks that have file name extensions “.xlsx” or “.xls”.

 

 

Leave a comment