簡體   English   中英

將 Msol Powershell 轉換為 Azure Powershell

[英]Convert Msol Powershell to Azure Powershell

我需要一些有關 Azure powershell 的幫助,因為我對 powershell 知之甚少,任何幫助將不勝感激。 (這將用於 Azure Runbook 檢查注冊 MFA 並將他們添加到組以進行條件訪問的人員)

我想將此 Msol Powershell 腳本轉換為 Azure powershell

#get group
$group = get-msolgroup - <groupIDnumber>

#get all users with stronge authentication 
$users = get-msoluser -all | select userprincipalname,objectid,StrongAuthenticationMethods
  | where {$_.StrongAuthenticationMethods -ne $null}

#add users to group
$users | foreach {
    add-msolgroupmember -groupobjectid $group.objectid -groupmembertype "user" -groupmemberobjectid $_.objectid
}

到目前為止我有

$group = get-AzureADgroup -objectid <groupidnumber>

檢查最新 AzureAD 模塊中的命令。

https://docs.microsoft.com/en-us/powershell/module/azuread/

我相信 cmdlet 結構是一樣的,你只需要用msol改變AzureAD

據我所知,無法使用 AzureAD cmdlet 獲取 StrongAuthenticationMethods 屬性(或其等效項)。 長期以來一直要求添加此內容: https : //feedback.azure.com/forums/169401-azure-active-directory/suggestions/20249953-powershell-and-graph-api-support-for-managing-mult?page =1&每頁=20

您可以從 Microsoft Graph API 獲取用戶的身份驗證方法, 網址https://graph.microsoft.com/beta/users/{id}/authentication/methods 請參閱https://docs.microsoft.com/en-us/graph/api/resources/authenticationmethod?view=graph-rest-beta

但是,如果您真的只想將這些用戶添加到條件訪問組中,是否可以只創建條件訪問策略? 請參閱https://docs.microsoft.com/en-us/azure/active-directory/authentication/tutorial-enable-azure-mfa

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM