{"id":2461,"date":"2017-05-29T12:03:42","date_gmt":"2017-05-29T11:03:42","guid":{"rendered":"https:\/\/www.lieben.nu\/liebensraum\/?p=2461"},"modified":"2017-05-29T12:03:42","modified_gmt":"2017-05-29T11:03:42","slug":"deploying-the-new-onedrive-next-generation-sync-client-as-msi-through-intune-to-windows-10","status":"publish","type":"post","link":"https:\/\/lieben.nu\/liebensraum\/2017\/05\/deploying-the-new-onedrive-next-generation-sync-client-as-msi-through-intune-to-windows-10\/","title":{"rendered":"Deploying the new Onedrive Next Generation Sync client as MSI through Intune to Windows 10"},"content":{"rendered":"<p>Onedrive for Business&#8217;s client, the new Next Generation Sync client, is awesome. Obviously.<\/p>\n<p>So you want it on your devices, but Microsoft distributes it as .exe. Nasty, because I want to manage Windows 10 as mobile devices through Intune, and that only allowes me to distribute as MSI.<\/p>\n<p>I created an MSI for Onedrive for Business&#8217;s Next Generation Client using <a href=\"http:\/\/www.advancedinstaller.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Advanced Installer<\/a>. Because I&#8217;m not allowed to redistribute Microsoft&#8217;s .exe, this MSI <a href=\"https:\/\/go.microsoft.com\/fwlink\/?linkid=844652\" target=\"_blank\" rel=\"noopener noreferrer\">downloads the .exe from Microsoft&#8217;s website<\/a>, it uses \/silent and \/takeover as installation switches.<!--more--><\/p>\n<p>This is the installer that self-downloads Onedrive NGen:\u00a0<a href=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/05\/OnedriveNGSC.msi\">OnedriveNGSC.msi<\/a>\u00a0(right click, save as).<\/p>\n<p>Optionally, you can change the URL from which the .exe installer is downloaded by supplying downloadURI as parameter to the MSI. (e.g. msiexec \/i OnedriveNGSC.msi downloadURI=&#8221;http:\/\/www.example.com\/file.exe&#8221;)<\/p>\n<p>The MSI is an empty placeholder for the following Powershell script:<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\nParam(\n$downloadURI\n)\n\nfunction runProcess ($cmd, $params, $windowStyle=1) {\n    $p = new-object System.Diagnostics.Process\n    $p.StartInfo = new-object System.Diagnostics.ProcessStartInfo\n    $exitcode = $false\t\n    $p.StartInfo.FileName = $cmd\n    $p.StartInfo.Arguments = $params\n    $p.StartInfo.UseShellExecute = $False\n    $p.StartInfo.RedirectStandardError = $True\n    $p.StartInfo.RedirectStandardOutput = $True\n    $p.StartInfo.WindowStyle = $windowStyle; #1 = hidden, 2 =maximized, 3=minimized, 4=normal\n    $null = $p.Start()\n    $output = $p.StandardOutput.ReadToEnd()\n    $exitcode = $p.ExitCode\n    $p.Dispose()\t\n    $exitcode\n    $output\n}\n\n#download the client\n$exePath = Join-Path $Env:Temp &quot;onedriveNGSC.exe&quot;\ntry{\n\t\tinvoke-webrequest $downloadURI -OutFile $exePath -ErrorAction Stop\n}catch{\n\t\tThrow &quot;Failed to download the installer from $downloadURI&quot;\n}\n\n$res = runProcess $exePath &quot;\/silent \/takeover&quot;\n\n#check if return code is 0\nif(0 -ne $res&#x5B;0]){\n\t\tThrow &quot;Failed to install client: $($res&#x5B;0]) $($res&#x5B;1])&quot;\n}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Onedrive for Business&#8217;s client, the new Next Generation Sync client, is awesome. Obviously. So you want it on your devices, but Microsoft distributes it as .exe. Nasty, because I want to manage Windows 10 as mobile devices through Intune, and that only allowes me to distribute as MSI. I created an MSI for Onedrive for &hellip; <a href=\"https:\/\/lieben.nu\/liebensraum\/2017\/05\/deploying-the-new-onedrive-next-generation-sync-client-as-msi-through-intune-to-windows-10\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Deploying the new Onedrive Next Generation Sync client as MSI through Intune to Windows 10<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[12,22,34,39],"tags":[],"class_list":["post-2461","post","type-post","status-publish","format-standard","hentry","category-ems","category-intune","category-onedrive-for-business","category-powershell"],"_links":{"self":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts\/2461","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/comments?post=2461"}],"version-history":[{"count":0,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts\/2461\/revisions"}],"wp:attachment":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/media?parent=2461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/categories?post=2461"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/tags?post=2461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}