通过Power Automate给用户分配license
通过Power automate 给用户分配license
1. Create AAD App Registration
2. Retrieve Token
3. Retrieve licenses list
4. Assign license
5. Remove license
首先需要在AAD App Registration中注册新的permission,并且把ID, Secret ID 获取到
这里的案例是使用21V系统的API endpoint,你需要根据你的环境找出API endpoint API endpoints of Office 365 for China | Microsoft Docs
在这需要获取access token
client_id=da0443c5-4137-4261-8f1d-85c6fb0b7a71&client_secret=00n0s.uK8_XA6_NhKC8H7_X4h.72tq.BTE&resource=https://microsoftgraph.chinacloudapi.cn&grant_type=client_credentials
这里需要把返回值转换成JSON格式
{ "type": "object", "properties": { "token_type": { "type": "string" }, "expires_in": { "type": "string" }, "ext_expires_in": { "type": "string" }, "expires_on": { "type": "string" }, "not_before": { "type": "string" }, "resource": { "type": "string" }, "access_token": { "type": "string" } } }
你也可以通过get请求获取到tenant下的license信息
可以通过POST请求来assign license
{ "addLicenses": [ { "disabledPlans": [ ], "skuId": "1e812b99-651f-441b-b352-e7da2d46fc22" } ], "removeLicenses": [] }
Remove license 同样
{ "addLicenses": [ { "disabledPlans": [ "113feb6c-3fe4-4440-bddc-54d774bf0318" ], "skuId": "eb4df4a1-51ed-47b3-a544-8be36bd05571" } ], "removeLicenses": [ "1e812b99-651f-441b-b352-e7da2d46fc22" ] }
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· 【.NET】调用本地 Deepseek 模型
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
· 上周热点回顾(2.17-2.23)
· 如何使用 Uni-app 实现视频聊天(源码,支持安卓、iOS)