PowerShell的 - 使用Microsoft帐户连接到Azure中的Active Directory [英] PowerShell - Connecting to Azure Active Directory using Microsoft Account
问题描述
我有一个Azure订阅该预订管理员帐户是一个Microsoft帐户。然后我又增加了微软帐户作为共同管理人。有人告诉我,当我添加共同管理员,它被添加到我的订阅的默认广告作为访客
用户。我真正想做到的是从访客
更改用户类型为成员
。对于这一点,我建议使用Azure的AD PowerShell的,这是我在哪里挣扎。
I have an Azure subscription where the subscription administrator account is a Microsoft Account. I then added another Microsoft Account as a co-administrator. I'm told that when I add a co-administrator, it gets added to my subscription's default AD as a Guest
user. What I really want to accomplish is change the user type from Guest
to Member
. For this, I am advised to use Azure AD PowerShell and this is where I am struggling.
我已经安装了相关的PS模块(基于此链接: https://msdn.microsoft.com/en-us/library/azure/jj151815.aspx )。
I've already installed related PS Modules (based on this link: https://msdn.microsoft.com/en-us/library/azure/jj151815.aspx).
因此,这里是我在做什么:
So here's what I am doing:
首先,这是我发出命令:
First, this is the command I am issuing:
$msolcred = get-credential
我得到提示输入我的凭据,我提供了,然后我运行下面的命令:
I get prompted for entering my credentials which I provide and then I run the following command:
connect-msolservice -credential $msolcred
当我这样做,我得到以下错误:
When I do this, I get the following error:
connect-msolservice : The user name or password is incorrect. Verify your user name, and then type your password again.
At line:1 char:1
+ connect-msolservice -Credential $cred -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [Connect-MsolService], MicrosoftOnlineException
+ FullyQualifiedErrorId : 0x80048821,Microsoft.Online.Administration.Automation.ConnectMsolService
我甚至试图把用户名作为 domainname.onmicrosoft.com \\用户名
,但仍得到相同的结果。
I even tried putting the username as domainname.onmicrosoft.com\username
but still get the same result.
所以我的问题是:
- 它甚至有可能使用的是Microsoft帐户? 通过PowerShell来连接到Azure的AD
- 如果可以的话,那我应该怎么指定用户名?我曾经尝试都
用户名
以及域名\\用户名
和我同样的错误。 - 如果这是不可能的,那么有什么替代的解决方案?我是不是应该建立在该广告的用户,并把在具有管理权限的用户角色的用户(因为这是我想做的事情)?
- Is it even possible to connect to Azure AD via PowerShell using Microsoft Account?
- If it is possible, then how should I specify the username? I have tried both
username
as well asdomainname\username
and I got the same error. - If it is not possible, then what's the alternate solution? Should I just create a user in that AD and put that user in a role that has permission to manage users (as this is what I want to do)?
对此任何见解将是非常美联社preciated。
Any insights regarding this would be highly appreciated.
推荐答案
登录到AAD PowerShell中使用Microsoft帐户目前不支持。你的方法(请即原生的目录新用户)是要走的路。
Signing in to AAD PowerShell with a Microsoft Account is not currently supported. Your approach (make a new user that is "native" to the directory) is the way to go.
这篇关于PowerShell的 - 使用Microsoft帐户连接到Azure中的Active Directory的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!