With AzureAD joined and Intune MDM controlled Windows 10 devices I like to provide the user access to the company portal.

If this is a 1:1 device I will just deploy the Company Portal App with intune to the user.

But in a scenario where there is many users on 1 device – we need to provisioned the Company Portal App as part of a image. In this blogpost I will show how it is done with MDT.


Before we get started there is some prerequisite that need to be in place.

We need a Azure AD that allows us to signup for Microsoft Windows Store for Business.

The Windows Store for Business needs to be configured.


First login in to the Windows Store for Business with a global admin.

Search for Company Portal.

Select the Company Portal App

WSfB_CP1

Then get the APP – if you like in my case already own the app then select Offline and manage

WSfB_CP2

Then Download the App

WSfB_CP3

Generate the Unencoded licens

WSfB_CP4

Save the .xml file

WSfB_CP5

Now you have the Company Portal App file and license file ready to create a deployment packages in the deployment system – in this case MDT.


Creating the Company Portal as an App in the deployment system – in this case MDT.

I start by creating a folder with the App name: Microsoft.CompanyPortal

In the folder I create a install script file and a source folder

App-MDT-01

In the source folder put the previous downloaded app and license file

App-MDT-02

The install script can look like this – there is many ways to create a install script to provisioned and Appx packaged.

App-MDT-03

<#

##################################################################################

# Script name: INSTALL-MicrosoftCompanyPortal.ps1

# Created: 2016-06-24

# Modified last: 2016-06-25

# version: v1.0

# Author: Per Larsen

# Homepage: https://osddeployment.wordpress.com

##################################################################################

##################################################################################

# Disclaimer:

# ———–

# This script is provided “AS IS” with no warranties, confers no rights and

# is not supported by the author.

##################################################################################

#>

Function Get-ScriptPath

{

$Invocation = (Get-Variable MyInvocation -Scope 1).Value

Split-Path $Invocation.MyCommand.Path

}

$AppFolder = Join-Path -Path (Get-ScriptPath) -ChildPath “Source”

If (Test-Path -Path $AppFolder)

{

$AppFile = (Get-ChildItem -Path $AppFolder -Include “*appx*” -Recurse).FullName

If ($AppFile -eq $null)

{

Write-Host “Source files not found. Skipping installation.”

}

Else

{

$Licensefile = (Get-ChildItem -Path $AppFolder -Include “*xml” -Recurse).FullName

Add-AppxProvisionedPackage -Online -PackagePath $AppFile -LicensePath $Licensefile

}

}

Else

{

Write-Host “Source files not found. Skipping installation.”

}


 

Now we are ready to create the Application in MDT

Select New Application in the Deployment Workbench

App-MDT-04

Click Next

App-MDT-05

  1. Enter a Publisher (Optional)
  2. Enter a Application name “Microsoft.CompanyPortal”
  3. Enter Version (Optional)
  4. Click Next

App-MDT-06

Browse for the previous created folder with the Company Portal

Click Next

App-MDT-07

Click Next

App-MDT-08

Enter the Command line installation string:

%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\powershell.exe  -NoProfile -ExecutionPolicy bypass -File “INSTALL-MicrosoftCompanyPortal.ps1”

Click NextApp-MDT-09

Click Next

App-MDT-10

Click Finish

App-MDT-11

Now go into the MDT Task Sequence and application just created

App-MDT-12

Now deploy Sequence to a Device


When the OS deployment is finished then we can make control to see if the Company Portal is provisioned in the Windows 10 OS by running this command:

Get-AppxProvisionedPackage -Online

CompanyPortal

The Company Portal will now be installed on any new user that login on the device.

CompanyPortal1