TypeError:&quot&quot' adgroup'&quot对象不可订阅
- 使用Python SDK在Azure中创建AD组后,什么是ADGROUP类型,
- 如何获取Object_ID或将其存储在列表中,
- 我想使用Azure Python SDK创建多个组,以JSON格式传递组名称,我想获得输出并将信息存储在JSON中,但它引发了我在标题中所述的错误
from azure.common.credentials import ServicePrincipalCredentials
from azure.graphrbac import GraphRbacManagementClient
from azure.graphrbac.models import GroupCreateParameters
import json
jsonfile = open('csvjson.json')
data = json.load(jsonfile)
credentials = ServicePrincipalCredentials(
client_id = "",
secret = "",
tenant = "",
resource = 'https://graph.windows.net')
tenant_id = ""
graphrbac_client = GraphRbacManagementClient(
credentials,
tenant_id
)
groupdict = []
for i in data:
group = graphrbac_client.groups.create(GroupCreateParameters(display_name=i['Group Name'], mail_nickname=i['Mail Nick Name']), raw=False)
print(type(group))
- what is ADGroup type
- after creating the AD group in azure using python sdk how to fetch the object_id or store that in a list
- im trying to create multiple groups using azure python sdk, passing the group name in json format, i would like to obtain the output and store the info in a json but it throw the error which i have stated in the Title
from azure.common.credentials import ServicePrincipalCredentials
from azure.graphrbac import GraphRbacManagementClient
from azure.graphrbac.models import GroupCreateParameters
import json
jsonfile = open('csvjson.json')
data = json.load(jsonfile)
credentials = ServicePrincipalCredentials(
client_id = "",
secret = "",
tenant = "",
resource = 'https://graph.windows.net')
tenant_id = ""
graphrbac_client = GraphRbacManagementClient(
credentials,
tenant_id
)
groupdict = []
for i in data:
group = graphrbac_client.groups.create(GroupCreateParameters(display_name=i['Group Name'], mail_nickname=i['Mail Nick Name']), raw=False)
print(type(group))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论