{"id":824,"date":"2023-11-08T11:36:19","date_gmt":"2023-11-08T10:36:19","guid":{"rendered":"https:\/\/backes.nu\/?p=824"},"modified":"2023-11-08T11:36:19","modified_gmt":"2023-11-08T10:36:19","slug":"updated-microsoft-365-apps","status":"publish","type":"post","link":"https:\/\/backes.nu\/index.php\/2023\/11\/08\/updated-microsoft-365-apps\/","title":{"rendered":"Updated: Microsoft 365 Apps"},"content":{"rendered":"<p>This is a refresh of my old post <a href=\"https:\/\/backes.nu\/index.php\/2020\/10\/09\/microsoft-365-apps-office-365-hantering-i-mecm-sccm\/\" target=\"_blank\" rel=\"noopener\">Microsoft 365 Apps (Office 365) hantering i MECM (SCCM)<\/a>, or maybe I should write &#8220;a refresh of the script&#8221;.<\/p>\n<p>In this post, I ensure that the Office Deployment Tool (ODT) is the latest version to support new version\/function of Microsoft 365 Apps setup.<br \/>\nI use a modified Powershell script created by Marco Hofmann &amp; Trond Eric Haavarstein to suit my idea.<br \/>\nOriginal script: https:\/\/www.meinekleinefarm.net\/download-and-install-latest-office-365-deployment-tool-odt<\/p>\n<p>What this version of the script does:<\/p>\n<p>Download the latest version of the Office Deployment Tool (ODT).<br \/>\nChecks if it&#8217;s a newer version of the Office 365 Deployment Tool (ODT), and if it&#8217;s a newer version, extracts it to a subfolder with the version number as the folder name. If it is not a newer version, skips this step<br \/>\nThen copies the new setup.exe to both the folder for the source files and the application package in ConfigMgr<br \/>\nAnd for last it runs the setup.exe (with download xml-file) to download allt the Microsoft 365 Apps<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n\r\n&lt;#\r\n.SYNOPSIS\r\n    Download latest Office Deployment Tool (ODT) and Office setup files\r\n.DESCRIPTION\r\n    Download latest Office Deployment Tool (ODT), extract setup.exe and download Office setup-files.\r\n.EXAMPLE\r\n    PS:&gt; \\\\DFSSHARE.ORGANISATION.ORG\\...\\download.ps1\r\n    Downloads latest officedeploymenttool.exe\r\n    Creates a sub-directory for each new version\r\n    Copies the setup.exe from the sub-directory to source-directory (incl. cmsetup-directory) and download Office setup-files\r\n.NOTES\r\n    Author: Magnus B\u00e4cke\r\n    URL: https:\/\/backes.nu\r\n    Original Author: Marco Hofmann and Trond Eric Haavarstein Original Author URL: https:\/\/www.meinekleinefarm.net and https:\/\/xenappblog.com\/ \r\n    This is the original script: https:\/\/www.meinekleinefarm.net\/download-and-install-latest-office-365-deployment-tool-odt\r\n.LINK\r\n    https:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=49117\r\n#&gt;\r\n \r\n$StartDTM = (Get-Date)\r\n$LogDTM = (Get-Date -format &quot;yyyy-MM-dd_HH-mm-ss&quot;)\r\n$ODTDownload = &quot;\\\\DFSSHARE.ORGANISATION.ORG\\Office365SetupFiles$\\ODTDownload\\&quot;              # &lt;-- You need to change the path\r\n$LogPS = &quot;\\\\DFSSHARE.ORGANISATION.ORG\\Office365SetupFiles$\\Logs\\$LogDTM.log&quot;                # &lt;-- You need to change the path\r\n$SourcePath = &quot;\\\\DFSSHARE.ORGANISATION.ORG\\Office365SetupFiles$\\&quot;                           # &lt;-- You need to change the path\r\n$SetupPath = &quot;\\\\DFSSHARE.ORGANISATION.ORG\\CMSourceFiles$\\Applications\\Microsoft 365\\Files\\&quot; # &lt;-- You need to change the path\r\n$Downloadxml = &#039;download.xml&#039;                                                               # &lt;-- You need to change this to the name of your Office download XML-file here, or name your XML-file download.xml\r\n&lt;# No need for any changes below here#&gt;\r\n$DownloadURL = (Invoke-WebRequest -Uri &quot;https:\/\/www.microsoft.com\/en-us\/download\/confirmation.aspx?id=49117&quot;).Links | Where-Object href -like &#039;*exe&#039; | select -First 1 | select -expand href\r\n$SaveDir = &quot;$ODTDownload\\officedeploymenttool.exe&quot;\r\n$ProgressPreference = &#039;SilentlyContinue&#039;\r\n\r\nSet-Location $ODTDownload\r\n\r\n\r\nWrite-Verbose &quot;Setting Arguments&quot; -Verbose\r\nStart-Transcript $LogPS\r\n\r\nWrite-Verbose &quot;Download latest version of Office Deployment Tool (ODT).&quot; -Verbose\r\n\r\nInvoke-WebRequest -Uri $DownloadURL -OutFile $SaveDir\r\n\r\nWrite-Verbose &quot;Read version number from downloaded file&quot; -Verbose\r\n$Version = (Get-Command .\\officedeploymenttool.exe).FileVersionInfo.FileVersion\r\n\r\nWrite-Verbose &quot;If downloaded ODT file is newer, create new sub-directory.&quot; -Verbose\r\nif( -Not (Test-Path -Path $Version ) ) {\r\n    New-Item -ItemType directory -Path $Version\r\n    Write-Verbose &quot;Extract setup.exe from ODT&quot; -Verbose\r\n    .\\officedeploymenttool.exe \/quiet \/extract:.\\$Version\r\n    start-sleep -s 5\r\n    Write-Verbose &quot;New folder created $Version&quot; -Verbose\r\n    Set-Location $Version\r\n    Copy-item &quot;.\\setup.exe&quot; -Destination $SourcePath -Force\r\n    Write-Verbose &quot;setup-exe copied from $Version to $SourcePath &quot; -Verbose\r\n    Copy-item &quot;.\\setup.exe&quot; -Destination $SetupPath -Force\r\n    Write-Verbose &quot;setup-exe copied from $Version to $SetupPath (CM O365 setup Source files)&quot; -Verbose\r\n}\r\nelse {\r\n    Write-Verbose &quot;Version identical. Skipping folder creation.&quot; -Verbose\r\n}\r\n\r\nSet-Location $SourcePath\r\nWrite-Verbose &quot;Downloading Office setup-files according to the XML-file.&quot; -Verbose\r\nStart-Process &quot;.\\setup.exe&quot; -ArgumentList &quot;\/download $Downloadxml&quot; -Wait -PassThru \r\n\r\nstart-sleep -s 15\r\n\r\nWrite-Verbose &quot;Stop logging&quot; -Verbose\r\n$EndDTM = (Get-Date)\r\nWrite-Verbose &quot;Elapsed Time: $(($EndDTM-$StartDTM).TotalSeconds) Seconds&quot; -Verbose\r\nWrite-Verbose &quot;Elapsed Time: $(($EndDTM-$StartDTM).TotalMinutes) Minutes&quot; -Verbose\r\nStop-Transcript\r\n\r\n<\/pre>\n<p>Id\u00e9a: Use Task Scheduler to run this late on the second tuesday (or early on the second wednesday) in the month to always have the latest Apps downloaded.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a refresh of my old post Microsoft 365 Apps (Office 365) hantering i MECM (SCCM), or maybe I should write &#8220;a refresh of the script&#8221;. In this post, I ensure that the Office Deployment Tool (ODT) is the&#8230;..<\/p>\n","protected":false},"author":1,"featured_media":829,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5],"tags":[28,90,107,97,96],"class_list":["post-824","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-shared-with-the-world","tag-configmgr","tag-microsoft-365-apps","tag-odt","tag-office-365","tag-office-deployment-tool"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/backes.nu\/wp-content\/uploads\/2023\/11\/m365.png?fit=411%2C396&ssl=1","jetpack-related-posts":[],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5Cu3K-di","_links":{"self":[{"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/posts\/824","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/comments?post=824"}],"version-history":[{"count":5,"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/posts\/824\/revisions"}],"predecessor-version":[{"id":830,"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/posts\/824\/revisions\/830"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/media\/829"}],"wp:attachment":[{"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/media?parent=824"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/categories?post=824"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/tags?post=824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}