Adding a Co-administrator via PowerShell

坚强是说给别人听的谎言 提交于 2019-12-04 04:24:37

问题


I know how to add a co-administrator via the portal, but need a way to add it via PowerShell.

I need this method as I have lost access to the login id, but have the publish setting file so can administrator my virtual machines.


回答1:


Unfortunately you can't. Azure PowerShell Cmdlets are essentially wrapper over Azure Service Management API and currently the API does not expose any method to add co-admins programmatically.




回答2:


Azure have rolled out Roll Based Access Control which will allow you to automate the adding of new admins to your Azure Subscription. Intro here: https://azure.microsoft.com/en-us/documentation/articles/role-based-access-control-configure/

You would add a new user as an Owner at the Subscription scope. These operations are available using both PowerShell and REST



来源:https://stackoverflow.com/questions/23286524/adding-a-co-administrator-via-powershell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!