【问题标题】:Azure Resource/Resource Groups using AD Groups使用 AD 组的 Azure 资源/资源组
【发布时间】:2022-08-05 04:37:06
【问题描述】:

我们正在尝试找到一种方法来获取 AD 组映射到的资源列表。我们有一个庞大的 AD 组列表(17k+ AD 组),我们必须更新 AD 组所属资源的标签。我们有一个批量更新资源标签的脚本,但我们没有这些特定资源的资源列表。

    标签: azure-active-directory


    【解决方案1】:

    As you are confirming that each resource that you have created in Azure has been assigned a tag of the Azure AD group that it is mapped to, then it is quite aptly possible to get the list of resources for which a particular group is mentioned as a tag in it. For that purpose, kindly execute the below powershell command with atleast ‘Contributor’ role Azure assignment to the ID through which this command will be executed

    要获得标记为“Reason”为“Repro”的确切值的 Azure 资源列表,使用以下命令:-

      (Get-AzResource -Tag @{ “Reason"="Repro"}).Name
    

    输出: -

    同样,如果你想要具有标签值“原因:复制”的资源组列表,具有确切的名称和值,请使用以下 powershell 命令:-

     (Get-AzResourceGroup -Tag @{ "Reason"="Repro" }).ResourceGroupName
    

    输出: -

    要了解有关上述命令的更多信息,请参阅以下文档链接:-

    https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources?tabs=json#list-by-tag

    【讨论】:

      猜你喜欢
      • 2020-07-26
      • 1970-01-01
      • 1970-01-01
      • 2014-05-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-30
      • 2020-05-17
      相关资源
      最近更新 更多