获取用户有权访问的资源组列表 [英] Get list of resource groups the user has permissions for

查看:150
本文介绍了获取用户有权访问的资源组列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试获取用户有权访问的所有资源组的列表.

I'm trying to get a list of all the resource groups the user has permissions for.

到目前为止,我完成的是一个带有AzureRM的Powershell脚本,该脚本在所有现有资源组上进行迭代并查询用户名.

What I accomplished so far is a Powershell script with AzureRM that iterates over all the existing resource groups and queries for the username. 

有效,但需要永远! (大约120个RGs atm时为20分钟)

Works but takes forever! (20 min for ~120 RGs atm)

对于我的用例,API(图形,Azure管理)没有任何有用的命令. (据我所知)

The APIs (Graph, Azure Management) don't have any useful commands for my use case. (as far as I know)

当您打开门户时,选择"Azure Active Directory",选择一个用户-然后单击"Azure resources".您会得到我需要的完美清单!

When you open the portal, choose "Azure Active Directory", select a user - then click on "Azure resources" you will get the perfect list I need!

我找不到脚本访问列表的方式.有人对此有解决方案吗?

I can't find a scripted way to access the list. Does anyone have a solution for that? 

谢谢

汤姆

推荐答案

Are you trying to get the list of all RBAC permissions for all resources which users have permissions for the resource group? If so, I would suggest you to refer the following document link. See if this helps.

参考链接:- https://docs.microsoft.com/zh-CN/azure/role-based-access-control/role-assignments-powershell

Reference link:- https://docs.microsoft.com/en-us/azure/role-based-access-control/role-assignments-powershell


这篇关于获取用户有权访问的资源组列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆