exam questions

Exam MS-100 All Questions

View all questions & answers for the MS-100 exam

Exam MS-100 topic 3 question 39 discussion

Actual exam question from Microsoft's MS-100
Question #: 39
Topic #: 3
[All MS-100 Questions]

Your company has a Microsoft 365 subscription.
Your plan to add 100 newly hired temporary users to the subscription next week.
You create the user accounts for the new users.
You need to assign licenses to the new users.
Which command should you run?
A.

B.

C.

D.

Show Suggested Answer Hide Answer
Suggested Answer: B
The first line gets all users from the Temp department that have a UsageLocation assigned and stores them in the $NewStaff variable. You cannot use PowerShell to assign a license to a user that does not have a UsageLocation configured.
The second line adds the licenses to each user in the $NewStaff variable.
Reference:
https://docs.microsoft.com/en-us/office365/enterprise/powershell/assign-licenses-to-user-accounts-with-office-365-powershell

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
hhaywood
Highly Voted 4 years, 2 months ago
incorrect syntax - should be Set-AzureADUserLicense -AssignedLicenses "
upvoted 5 times
F_M
4 years, 1 month ago
And Get-ADUser -All -Filter "Department eq 'Temp'"
upvoted 1 times
chaoscreater
4 years, 1 month ago
That's for onprem, not AAD
upvoted 1 times
F_M
4 years, 1 month ago
Sorry, Get-AzureADUser -All -Filter "Department eq 'Temp'"
upvoted 1 times
...
...
...
...
emanresu
Highly Voted 3 years, 3 months ago
Answer B is correct but Set-AzureADUserLicense will be retired and replaced with Set-MgUserLicense https://docs.microsoft.com/en-us/microsoft-365/enterprise/assign-licenses-to-user-accounts-with-microsoft-365-powershell?view=o365-worldwide
upvoted 5 times
...
Wojer
Most Recent 3 years, 7 months ago
the first part is completely wrong because department and usage location are not a part of that command that is the proper second part Set-AzureADUserLicense -AssignedLicenses
upvoted 1 times
...
YClaveria
3 years, 9 months ago
B is right if Get-MsolUser and Set-MsolUserLicense have been used.
upvoted 2 times
...
lafcow
3 years, 11 months ago
♦ C $userUPN="<user sign-in name (UPN)>" $planName="<license plan name from the list of license plans>" $License = New-Object -TypeName Microsoft.Open.AzureAD.Model.AssignedLicense $License.SkuId = (Get-AzureADSubscribedSku | Where-Object -Property SkuPartNumber -Value $planName -EQ).SkuID $LicensesToAssign = New-Object -TypeName Microsoft.Open.AzureAD.Model.AssignedLicenses $LicensesToAssign.AddLicenses = $License Set-AzureADUserLicense -ObjectId $userUPN -AssignedLicenses $LicensesToAssign
upvoted 1 times
lafcow
3 years, 11 months ago
Actually there are no correct answers listed... "TimurKazan: should be B, but instead of ""-addlicenses" there must be "-assignedlicenses""
upvoted 1 times
...
...
TimurKazan
3 years, 11 months ago
should be B, but instead of ""-addlicenses" there must be "-assignedlicenses"
upvoted 4 times
...
melatocaroca
4 years, 1 month ago
to apply a license to a user using the Azure AD cmdlets (note the prefix): # Create the objects we’ll need to add and remove licenses $license = New-Object -TypeName Microsoft.Open.AzureAD.Model.AssignedLicense $licenses = New-Object -TypeName Microsoft.Open.AzureAD.Model.AssignedLicenses # Find the SkuID of the license we want to add – in this example we’ll use the O365_BUSINESS_PREMIUM license $license.SkuId = (Get-AzureADSubscribedSku | Where-Object -Property SkuPartNumber -Value “O365_BUSINESS_PREMIUM” -EQ).SkuID # Set the Office license as the license we want to add in the $licenses object $licenses.AddLicenses = $license # Call the Set-AzureADUserLicense cmdlet to set the license. Set-AzureADUserLicense -ObjectId “[email protected]” -AssignedLicenses $licenses So only B and C use Set-AzureADUserLicense, but location is only set in B, Answer B
upvoted 4 times
...
VikingSWE
4 years, 2 months ago
None of the answers seem correct. https://docs.microsoft.com/en-us/powershell/module/azuread/set-azureaduserlicense?view=azureadps-2.0
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...