使用MS图形模块而不是Azure AD模块强制执行2FA
我有无人看管的脚本来创建新的MS 365用户,该脚本当前执行以下操作:
$AuthObject = New-Object -TypeName Microsoft.Online.Administration.StrongAuthenticationRequirement
$AuthObject.RelyingParty = '*'
$AuthObject.State = 'Enabled'
$AuthObjectArray = @($AuthObject)
Set-MsolUser -UserPrincipalName $Email -StrongAuthenticationRequirements $AuthObjectArray
这可以在帐户中启用2FA。
我想从Azure AD模块(被弃用)迁移到MS Graph,如何使用“ Update-Mguser”,“ Update-MguserSetting”或“ New-Mguser”来实现相同的目标?
I have unattended scripts for creating new MS 365 users which currently do the following:
$AuthObject = New-Object -TypeName Microsoft.Online.Administration.StrongAuthenticationRequirement
$AuthObject.RelyingParty = '*'
$AuthObject.State = 'Enabled'
$AuthObjectArray = @($AuthObject)
Set-MsolUser -UserPrincipalName $Email -StrongAuthenticationRequirements $AuthObjectArray
This enables 2FA on the account.
I want to migrate away from the Azure AD module (being deprecated) to MS Graph, how do I achieve the same thing with 'Update-MgUser', 'Update-MgUserSetting' or 'New-MgUser'?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用New-MguserauthenticationPhoneMethod和new-Mguserauthenticationemailmethod
使其工作需要连接到MS Graph Beta端点
You can use New-MgUserAuthenticationPhoneMethod and New-MgUserAuthenticationEmailMethod
For them to work you need to connect to the MS Graph Beta endpoint
https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.identity.signins/new-mguserauthenticationphonemethod?view=graph-powershell-beta
https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.identity.signins/new-mguserauthenticationemailmethod?view=graph-powershell-beta