diff --git a/ConfigurationXML/ReadMe.md b/ConfigurationXML/ReadMe.md new file mode 100644 index 0000000..8a49817 --- /dev/null +++ b/ConfigurationXML/ReadMe.md @@ -0,0 +1,11 @@ +#Office Click-to-Run Product IDs + +Source: [Microsoft](https://support.microsoft.com/en-au/kb/2842297) + +The following product IDs are supported for use in Configuration.xml files with the Office Deployment Tool. + +|Product ID|Office 365 Plan| +|---|---| +|O365ProPlusRetail|Office ProPlus, Office 365 Enterprise E3, Office 365 Enterprise E5| +|O365BusinessRetail|Office 365 Business, Office 365 Business Premium| + diff --git a/Install-OfficeCTR.ps1 b/Install-OfficeCTR.ps1 new file mode 100644 index 0000000..c38fec2 --- /dev/null +++ b/Install-OfficeCTR.ps1 @@ -0,0 +1,128 @@ +<# +.SYNOPSIS +Install-OfficeCTR.ps1 - Office 365 CTR Install Script + +.DESCRIPTION +This PowerShell script will install Office 365 Click-to-Run on +client computers. + +This script is designed to work with Office 2016 builds of +Office 365 CTR, not Office 2013. + +Before using this script you should set up an shared folder for +your Office 365 CTR deployments by following the instructions +at http://practical365.com + +.PARAMETER InstallRoot +Specify the UNC path to the network share that hosts the Office 365 +setup and configuration files. + +.PARAMETER SKU +Specify the the Office CTR SKU to deploy (e.g. ProPlus, Business) + +.PARAMETER Channel +Specify the build channel to deploy (e.g. Current, Deferred) + +.EXAMPLE +.\Install-OfficeCTR.ps1 -InstallRoot \\mgmt\Installs\OfficeCTR -SKU ProPlus -Channel Deferred + +.NOTES +Written by: Paul Cunningham + +Find me on: + +* My Blog: http://paulcunningham.me +* Twitter: https://twitter.com/paulcunningham +* LinkedIn: http://au.linkedin.com/in/cunninghamp/ +* Github: https://github.com/cunninghamp + +For more Office 365 tips, tricks and news +check out Practical365. + +* Website: http://practical365.com +* Twitter: http://twitter.com/practical365 + +Change Log +V1.00, 22/09/2016 - Comment +#> + +#requires -version 4 + + +[CmdletBinding()] +param ( + + [Parameter(Mandatory=$true)] + [string]$InstallRoot, + + [Parameter(Mandatory=$true)] + [ValidateSet('Business','ProPlus', ignorecase=$true)] + [string]$SKU, + + [Parameter(Mandatory=$true)] + [ValidateSet('Current','Deferred','FirstReleaseCurrent','FirstReleaseDeferred',ignorecase=$true)] + [string]$Channel + + ) + + +function DoInstall { + + $ConfigurationXML = "$($InstallRoot)\$($SKU)\$($Channel)\configuration.xml" + + If (!(Test-Path $ConfigurationXML)) { + throw "Unable to locate a configuration XML file at $($ConfigurationXML)" + } + + $setuppath = "$($InstallRoot)\$($SKU)\$($Channel)\Setup.exe" + + if (!(Test-Path $setuppath)) { + throw "Unable to locate a Setup.exe file at $($setuppath)" + } + + Write-Host "Attempting to install Office 365 $($SKU) $($Channel)" + + try { + $process = Start-Process -FilePath "$($InstallRoot)\$($SKU)\$($Channel)\Setup.exe" -ArgumentList "/Configure $($InstallRoot)\$($SKU)\$($Channel)\configuration.xml" -Wait -PassThru -ErrorAction STOP + + if ($process.ExitCode -eq 0) + { + Write-Host -ForegroundColor Green "Office setup started without error." + } + else + { + Write-Warning "Installer exit code $($process.ExitCode)." + } + } + catch { + Write-Warning $_.Exception.Message + } + +} + +#Check if Office is already installed, as indicated by presence of registry key +$RegistryPath = 'HKLM:\SOFTWARE\Microsoft\Office\16.0\ClickToRunStore\Packages\{9AC08E99-230B-47e8-9721-4577B7F124EA}' + +if (Test-Path $RegistryPath) { + #Check for children + + $Item = Get-ItemProperty -Path $RegistryPath + + if (!($Item.'(default)' -eq $null)) { + #Office is installed, according to registry key. Nothing further to do. + EXIT + } + else { + #Registry key exists but default value is empty, install needed + DoInstall + } +} +else { + #Registry key doesn't exist, install needed + DoInstall +} + + + + + diff --git a/README.md b/README.md index 2954d81..ec9bb39 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,58 @@ -# Office-365-Deploy -Office 365 Client Deployment Scripts +#Office 365 Client Deployment Scripts + +This repository hosts PowerShell scripts that assist with the deployment of Office 365 client software. + +The scripts included at this time are: + +- Install-OfficeCTR.ps1 + +If you're looking for more complex, featured scripts you might be interested in [Microsoft's Office Deployment Scripts for IT Pros](http://officedev.github.io/Office-IT-Pro-Deployment-Scripts/). + +##Install-OfficeCTR.ps1 - Office 365 CTR Install Script + +This PowerShell script will install Office 365 Click-to-Run when it is run manually, or as a logon/startup script. Install-OfficeCTR.ps1 supports both the ProPlus and Business SKU for Office 365, as well as the four channels: + +- Deferred +- Current +- First Release Deferred +- First Release Current + +This script is designed to work with Office 2016 builds of Office 365 CTR, not Office 2013. + +Before using this script you should set up an shared folder for your Office 365 CTR deployments by following the instructions at [Practical 365](https://practical365.com). + +###Usage: + +Install-OfficeCTR.ps1 uses the following parameters: + +- **InstallRoot** - Specify the UNC path to the network share that hosts the Office 365 +setup and configuration files. +- **SKU** - Specify the the Office CTR SKU to deploy (e.g. ProPlus, Business) +- **Channel** - Specify the build channel to deploy (e.g. Current, Deferred) + +The three parameters are used by the install script to locate the appropriate setup and configuration files in your install share on the network. + +Example: + +``` +.\Install-OfficeCTR.ps1 -InstallRoot \\mgmt\Installs\OfficeCTR -SKU ProPlus -Channel Deferred +``` + +The example above will look for setup and configuration files in **\\\mgmt\Installs\OfficeCTR\ProPlus\Deferred** + + + +##Credits +Written by: Paul Cunningham + +Find me on: + +* My Blog: http://paulcunningham.me +* Twitter: https://twitter.com/paulcunningham +* LinkedIn: http://au.linkedin.com/in/cunninghamp/ +* Github: https://github.com/cunninghamp + +For more Office 365 tips, tricks and news check out Practical 365. + +* Website: [http://practical365.com]() +* Twitter: [http://twitter.com/practical365]() \ No newline at end of file