< Back

Set-O365License

Sat Jan 18, 2020 4:59 pm

NAME Set-O365License



SYNOPSIS

Checks if the users location is configured and if not configures the location for NL and sets the required

licences.





SYNTAX

Set-O365License [-userPrincipalName] <Object> [[-location] <Object>] [-licenseType] <String[]> [-ErrorLog]

[[-LogFile] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

Checks if the users location is configured and if not configures the location for NL and sets the required

licences.





PARAMETERS

-userPrincipalName <Object>

Provide the UPN of the user



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-location <Object>

Provide the required location



Required? false

Position? 2

Default value NL

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-licenseType <String[]>

Provide the required licenses



Required? true

Position? 3

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-ErrorLog [<SwitchParameter>]

Switch to turn on Error logging



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-LogFile <String>



Required? false

Position? 4

Default value .\\Set-Office365License.log

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\WINDOWS\\system32>Set-O365License -userPrincipalName test@contoso.com -licenseType EMS



User test@contoso.com is licensed for Enterprise Mobility and Security!









-------------------------- EXAMPLE 2 --------------------------



PS C:\\WINDOWS\\system32>$user = import-csv c:\\temp\\test.csv



PS C:\\WINDOWS\\system32> $user | foreach{Set-O365License -userPrincipalName $_.userPrincipalName -location NL

-licenseType EMS,O365E3}











RELATED LINKS