3

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.

Lachie White
  • 1,246
  • 2
  • 14
  • 21
Sachin
  • 65
  • 2
  • 6

2 Answers2

4

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.

Gaurav Mantri
  • 128,066
  • 12
  • 206
  • 241
0

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

GavinB
  • 515
  • 5
  • 15
  • 4
    Yes, however (at this time) you still cannot grant co-admin permissions to a user in order to access V1 resources in the V1 portal, or through ASM PowerShell. That is, RBAC permissions don't apply to the V1 stack, only ARM & Graph API. – JoeBrockhaus Nov 23 '15 at 06:17