diff --git a/Office-ProPlus-Deployment/Deploy-OfficeClickToRun/10-ExampleDeploySilentWithVersion.ps1 b/Office-ProPlus-Deployment/Deploy-OfficeClickToRun/10-ExampleDeploySilentWithVersion.ps1 new file mode 100644 index 000000000..57f965bc5 --- /dev/null +++ b/Office-ProPlus-Deployment/Deploy-OfficeClickToRun/10-ExampleDeploySilentWithVersion.ps1 @@ -0,0 +1,33 @@ +# Office ProPlus Click-To-Run Deployment Script example +# +# This script demonstrates how utilize the scripts in OfficeDev/Office-IT-Pro-Deployment-Scripts repository together to create +# Office ProPlus Click-To-Run deployment script that will be adaptive to the configuration of the computer it is run from + +param([Parameter(Mandatory=$false)][string]$OfficeVersion = "Office2016") + +Process { + $scriptPath = "." + + if ($PSScriptRoot) { + $scriptPath = $PSScriptRoot + } else { + $scriptPath = split-path -parent $MyInvocation.MyCommand.Definition + } + +#Importing all required functions +. $scriptPath\Generate-ODTConfigurationXML.ps1 +. $scriptPath\Edit-OfficeConfigurationFile.ps1 +. $scriptPath\Install-OfficeClickToRun.ps1 + +$targetFilePath = "$env:temp\configuration.xml" + +#This example will create an Office Deployment Tool (ODT) configuration file and include all of the Languages currently in use on the computer +#from which the script is run. It will then remove the Version attribute from the XML to ensure the installation gets the latest version +#when updating an existing install and then it will initiate a install + +#This script additionally sets the "AcceptEULA" to "True" and the display "Level" to "None" so the install is silent. + +Generate-ODTConfigurationXml -Languages AllInUseLanguages -TargetFilePath $targetFilePath | Set-ODTAdd -Version $NULL | Set-ODTDisplay -AcceptEULA $true -Level None | Install-OfficeClickToRun -OfficeVersion $OfficeVersion + +# Configuration.xml file for Click-to-Run for Office 365 products reference. https://technet.microsoft.com/en-us/library/JJ219426.aspx +} diff --git a/Office-ProPlus-Deployment/Deploy-OfficeClickToRun/azuredeploy.json b/Office-ProPlus-Deployment/Deploy-OfficeClickToRun/azuredeploy.json new file mode 100644 index 000000000..968a25a8c --- /dev/null +++ b/Office-ProPlus-Deployment/Deploy-OfficeClickToRun/azuredeploy.json @@ -0,0 +1,229 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.1", + "parameters": { + "vmAdminUserName": { + "type": "string", + "metadata": { + "description": "VM admin user name" + } + }, + "vmAdminPassword": { + "type": "securestring", + "metadata": { + "description": "VM admin password. The supplied password must be between 8-123 characters long and must satisfy at least 3 of password complexity requirements from the following: 1) Contains an uppercase character 2) Contains a lowercase character 3) Contains a numeric digit 4) Contains a special character." + } + }, + "vmOSVersion": { + "type": "string", + "defaultValue": "10-Enterprise-N", + "allowedValues": [ + "10-Enterprise-N", + "7.0-Enterprise-N", + "8.1-Enterprise-N" + ], + "metadata": { + "description": "Which version of Windows would like to deploy" + } + }, + "dnsLabelPrefix": { + "type": "string", + "metadata": { + "description": "DNS Label for the Public IP. Must be lowercase. It should match with the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$ or it will raise an error." + } + }, + "officeVersion": { + "type": "string", + "defaultValue": "Office2016", + "allowedValues": [ + "Office2016", + "Office2013" + ], + "metadata": { + "description": "Which version of Office would you would like to deploy" + } + } + }, + "variables": { + "storageName": "[concat(uniquestring(resourceGroup().id), 'standardsa')]", + "vnet01Prefix": "10.0.0.0/16", + "vnet01Subnet1Name": "Subnet-1", + "vnet01Subnet1Prefix": "10.0.0.0/24", + "vmImagePublisher": "MicrosoftVisualStudio", + "vmImageOffer": "Windows", + "vmOSDiskName": "VMOSDisk", + "vmVnetID": "[resourceId('Microsoft.Network/virtualNetworks', 'Vnet01')]", + "vmSubnetRef": "[concat(variables('VMVnetID'), '/subnets/', variables('Vnet01Subnet1Name'))]", + "vmStorageAccountContainerName": "vhds", + "vmNicName": "[concat(variables('VMName'), 'NetworkInterface')]", + "vmIP01Name": "VMIP01", + "vmName": "O365VM", + "storageType": "Premium_LRS", + "vmSize": "Standard_DS2", + "setupOfficeScriptUri": "https://raw.githubusercontent.com/daltskin/azure-quickstart-templates/patch-7/visual-studio-dev-vm-O365/scripts/", + "setupOfficeScriptFileName": "DeployO365SilentWithVersion.ps1", + "location" : "[resourceGroup().location]" + }, + "resources": [ + { + "name": "[variables('storageName')]", + "type": "Microsoft.Storage/storageAccounts", + "location": "[variables('location')]", + "apiVersion": "2015-06-15", + "tags": { + "displayName": "Storage01" + }, + "properties": { + "accountType": "[variables('storageType')]" + } + }, + { + "name": "VNet01", + "type": "Microsoft.Network/virtualNetworks", + "location": "[variables('location')]", + "apiVersion": "2015-06-15", + "tags": { + "displayName": "VNet01" + }, + "properties": { + "addressSpace": { + "addressPrefixes": [ + "[variables('vnet01Prefix')]" + ] + }, + "subnets": [ + { + "name": "[variables('vnet01Subnet1Name')]", + "properties": { + "addressPrefix": "[variables('vnet01Subnet1Prefix')]" + } + } + ] + } + }, + { + "name": "[variables('vmNicName')]", + "type": "Microsoft.Network/networkInterfaces", + "location": "[variables('location')]", + "apiVersion": "2015-06-15", + "dependsOn": [ + "[concat('Microsoft.Network/virtualNetworks/', 'Vnet01')]", + "[concat('Microsoft.Network/publicIPAddresses/', variables('vmIP01Name'))]" + ], + "tags": { + "displayName": "VMNic01" + }, + "properties": { + "ipConfigurations": [ + { + "name": "ipconfig1", + "properties": { + "privateIPAllocationMethod": "Dynamic", + "subnet": { + "id": "[variables('vmSubnetRef')]" + }, + "publicIPAddress": { + "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('vmIP01Name'))]" + } + } + } + ] + } + }, + { + "name": "[variables('vmName')]", + "type": "Microsoft.Compute/virtualMachines", + "location": "[variables('location')]", + "apiVersion": "2015-06-15", + "dependsOn": [ + "[concat('Microsoft.Storage/storageAccounts/', variables('storageName'))]", + "[concat('Microsoft.Network/networkInterfaces/', variables('vmNicName'))]" + ], + "tags": { + "displayName": "VM01" + }, + "properties": { + "hardwareProfile": { + "vmSize": "[variables('vmSize')]" + }, + "osProfile": { + "computerName": "[variables('vmName')]", + "adminUsername": "[parameters('vmAdminUsername')]", + "adminPassword": "[parameters('vmAdminPassword')]" + }, + "storageProfile": { + "imageReference": { + "publisher": "[variables('vmImagePublisher')]", + "offer": "[variables('vmImageOffer')]", + "sku": "[parameters('vmOSVersion')]", + "version": "latest" + }, + "osDisk": { + "name": "VMOSDisk", + "vhd": { + "uri": "[concat('http://', variables('storageName'), '.blob.core.windows.net/', variables('vmStorageAccountContainerName'), '/', variables('vmOSDiskName'), '.vhd')]" + }, + "caching": "ReadWrite", + "createOption": "FromImage" + } + }, + "networkProfile": { + "networkInterfaces": [ + { + "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('vmNicName'))]" + } + ] + } + }, + "resources": [ + { + "name": "SetupOffice", + "type": "extensions", + "location": "[variables('location')]", + "apiVersion": "2015-06-15", + "dependsOn": [ + "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]" + ], + "tags": { + "displayName": "SetupOffice" + }, + "properties": { + "publisher": "Microsoft.Compute", + "type": "CustomScriptExtension", + "typeHandlerVersion": "1.4", + "autoUpgradeMinorVersion": true, + "settings": { + "fileUris": [ + "[concat(variables('setupOfficeScriptUri'), variables('setupOfficeScriptFileName'))]", + "https://raw.githubusercontent.com/officedev/Office-IT-Pro-Deployment-Scripts/master/Office-ProPlus-Deployment/Deploy-OfficeClickToRun/DefaultConfiguration.xml", + "https://raw.githubusercontent.com/officedev/Office-IT-Pro-Deployment-Scripts/master/Office-ProPlus-Deployment/Deploy-OfficeClickToRun/Office2013Setup.exe", + "https://raw.githubusercontent.com/officedev/Office-IT-Pro-Deployment-Scripts/master/Office-ProPlus-Deployment/Deploy-OfficeClickToRun/Office2016Setup.exe", + "https://raw.githubusercontent.com/officedev/Office-IT-Pro-Deployment-Scripts/master/Office-ProPlus-Deployment/Deploy-OfficeClickToRun/Edit-OfficeConfigurationFile.ps1", + "https://raw.githubusercontent.com/officedev/Office-IT-Pro-Deployment-Scripts/master/Office-ProPlus-Deployment/Deploy-OfficeClickToRun/Generate-ODTConfigurationXML.ps1", + "https://raw.githubusercontent.com/officedev/Office-IT-Pro-Deployment-Scripts/master/Office-ProPlus-Deployment/Deploy-OfficeClickToRun/Install-OfficeClickToRun.ps1" + ], + "commandToExecute": "[concat('powershell -ExecutionPolicy bypass -File ', variables('setupOfficeScriptFileName'),' -OfficeVersion ', parameters('officeVersion'))]" + } + } + } + ] + }, + { + "name": "[variables('vmIP01Name')]", + "type": "Microsoft.Network/publicIPAddresses", + "location": "[variables('location')]", + "apiVersion": "2015-06-15", + "tags": { + "displayName": "VMIP01" + }, + "properties": { + "publicIPAllocationMethod": "Dynamic", + "dnsSettings": { + "domainNameLabel": "[parameters('dnsLabelPrefix')]" + } + } + } + ], + "outputs": { } + } +