Assign Microsoft StaffHub licenses to users

You must have Office 365 global admin permissions to do these steps. Be sure your users have Office 365 licenses, too.

  1. Sign in to Office 365.

  2. Go to the Office 365 admin center.

  3. Choose Users > Active users.

  4. Choose the user you want to assign the Microsoft StaffHub license to. Move the toggle to On.

Use PowerShell to assign licenses in bulk

Here are sample scripts for assigning licenses in bulk. See Assign licenses to user accounts with Office 365 PowerShell for more information.

1. Assign licenses to all users

$licenseObj = Get-MsolAccountSku | Where-Object {$_.SkuPartNumber -eq “DESKLESS"} 
$license = $licenseObj.AccountSkuId
 Get-MSOLUser -All | Set-MsolUserLicense -AddLicenses $license 

The license string will resemble <Contoso>:DESKLESS. In this string, the <Contoso> placeholder represents the name of your organization.

2. Assign to a “department” or some other property (in this example, department = retail

If you want to assign a license to a subset of users based on other metadata of the user record, you can add a Where-Object filter in the last line of the code. For example, if the Department field is populated and you want to assign a license only where the department name is “Retail," you can use the following cmdlet:

Get-MSOLUser -All | Where-Object {$_.department -eq ‘Retail'} | Set-MsolUserLicense -AddLicenses $license

3. Export all assigned users and then remove some people

If you want to create a file that includes a list of users and then remove from that list the names of the users to which you don't currently want licenses assigned, you can use the following cmdlet:

$licenseObj = Get-MsolAccountSku | Where-Object {$_.SkuPartNumber -eq “DESKLESS"} 
$license = $licenseObj.AccountSkuId 
Get-MsolUser -All | Select-Object Displayname, UserPrincipalName | ` 
Export-CSV -Path d:\ExportedUsers.csv -NoTypeInformation 

# Edit the file d:\ExportedUsers.csv and remove users who shouldn't be licensed before you run the following command

Import-Csv -Path d:\Exportedusers.csv | ForEach-Object `
{ Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -AddLicenses $license}

4. Remove licenses

If you want to remove licenses from users, replace -AddLicenses with -RemoveLicenses in any of these scripts.

See Also

Let Microsoft StaffHub provision accounts for deskless workers

Introducing Microsoft StaffHub

Share Facebook Facebook Twitter Twitter Email Email

Was this information helpful?

Great! Any other feedback?

How can we improve it?

Thank you for your feedback!