# Déploiement d'Office pour ses utilisateurs

---

## <span style="color: #3366ff;">Présentation</span>

Il existe différents moyens de déployer Office.

- Déploiement manuel : installation manuel sur chaque poste d'Office
- Déploiement par SCCM / MDT
- Déploiement par GPO depuis une source locale ou Microsoft

Je vais détailler ici la dernière.

---

## <span style="color: #3366ff;">Déploiement par GPO depuis une source locale</span>

On se rend sur cette page, et on rentre la manière dont l'on veut déployer Office.

[https://admin.microsoft.com/adminportal/#/modernonboarding/cdnwizard](https://admin.microsoft.com/adminportal/#/modernonboarding/cdnwizard)

Cela nous génère un fichier à télécharger en XML à inclure dans notre partage. On télécharge et on y place également l'ODT (Office Deployment Tool). Une fois les deux fichiers présents, on exécute la commande :

```
%DeployServer%setup.exe /configure %ConfigFile%
```

On remplace %DeployServer% par le chemin du setup (ODT) et %ConfigFile% par le chemin du fichier XML. Cela va télécharger Office.

On crée une GPO pour déployer Office en ajoutant ce script au logon des ordinateurs.

```shell
REM Beginning of Script
REM -------------------------------------------------------------------------------------------------------------------
setlocal
REM *********************************************************************
REM Environment customization begins here. Modify variables below.
REM *********************************************************************
REM Set DeployServer to a network-accessible location containing the Office source files.
set DeployServer=\\SRV-WSUS01\Office$\Production\
REM Set ConfigFile to the configuration file to be used for deployment (required)
set ConfigFile=\\SRV-WSUS01\Office$\Production\ConfigurationProd.xml
REM *********************************************************************
REM Deployment code begins here. Do not modify anything below this line (check quotes are quotes though).
REM *********************************************************************
IF NOT "%ProgramFiles(x86)%"=="" (goto ARP64) else (goto ARP86)
REM Operating system is X64. Check for 32 bit Office in emulated Wow6432 registry key
:ARP64
reg query HKLMSOFTWAREWOW6432NODEMicrosoftOffice16.0ClickToRunStorePackages{9AC08E99-230B-47e8-9721-4577B7F124EA}
if NOT %errorlevel%==1 (goto End)
REM Check for 32 and 64 bit versions of Office 2016 in regular registry key.(Office 64bit would also appear here on a 64bit OS)
:ARP86
reg query HKLMSOFTWAREMicrosoftOffice16.0ClickToRunStorePackages{9AC08E99-230B-47e8-9721-4577B7F124EA}
if %errorlevel%==1 (goto DeployOffice) else (goto End)
REM If 1 returned, the product was not found. Run setup here.
:DeployOffice
start /wait %DeployServer%setup.exe /configure %ConfigFile%
REM If 0 or other was returned, the product was found or another error occurred. Do nothing.
:End
Endlocal
REM End of Script REM ----------------------------------------------------------------------------------------------------------------------

```

---

## <span style="color: #3366ff;">Conclusion</span>

Office sera déployé.