A company has an Office 365 tenant that has an Enterprise E1 subscription.
You synchronize disabled user accounts from an Active Directory Domain Services environment.
You need to enable the user accounts in Office 365.
Which Windows PowerShell cmdlet should you run?
A.
Set-MsolUser
B.
Redo-MsolProvisionUser
C.
Set-MsolUserLicense
D.
Set-MsolUserPrincipalName
E.
Convert-MsolFederatedUser
F.
Set-MailUser
G.
Set-LinkedUser
H.
New-MsolUser
Explanation:
https://msdn.microsoft.com/en-us/library/dn194135.aspx
Note: This question is part of a series of questions that use the same or similar answer choices. An answer choice may be correct for more than one
question in the series. Each question is independent of the other questions in this series. Information and details provided in the question apply only to
that question.
I would have gone with A. When you dirsync a disabled user from on premise to Office 365 the user is created in Office 365 with the BlockCredential attribute set to True. The set-msoluser -userprincipalname -BlockCredential $false will enable that account.
But would’t the -BlockCredential $false tag change back to $true, the next time that the sync is run?
I think that you would need to change the UPN before enabling the user so that next time the sync happened it didn’t disable the users again.
Please advise if my reasoning is flawed.
I Agree with ExchGuy.
2.Determine how to update users that were disabled before our change. If you simply want to re/enable all currently disabled accounts, the below PowerShell sample might work well:
Connect-MsolService
$BlockedUsers = Get-MsolUser -EnabledFilter DisabledOnly -All
$i= 1
$BlockedUsers | ForEach-Object {
Write-Host ($_.UserPrincipalName + ” (” + $i + ” of ” + $BlockedUsers.count + “)” )
Set-MsolUser -UserPrincipalName $_.UserPrincipalName -BlockCredential $false
$i = $i + 1
}
Full agree with ExchGuy and Bas!
Agreed. Also, changing the user’s UPN is completely useless, has a far wider impact, and might not even be possible.
Yes, A is correct.
F*ck you naruc
https://docs.microsoft.com/en-us/powershell/module/msonline/set-msoluser?view=azureadps-1.0
“A” couldn’t be right because “This command sets block credential to $Tue for a user, which blocks them from being able to sign in. This cannot be done for a synced user”