-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getting immediate error when launching PowerZure #6
Comments
Does it tell you what line the error is on? |
yes, PowerZure.ps1:209 char:1 |
it doesn't seem to like -welcome. Once removed it, everything seems to work |
I'm thinking it has to do with the API call which pulls some info about the current user roles. Can you run the following code and tell me if you get the same error? (Just copy+paste into a powershell window)
|
Getting the same error but after this line: |
Ok, can you run this?
And check if you get any output? |
yes I get my tenantid. Id, type, tenants, and extendedproperties field. The accesstoken field is empty instead |
Try this:
If it errors, can you verify that $userid is populated (has content)? |
it errors and for some reason $userid has no content... |
Does $User have content? |
nope, only $username has content. |
Ok so Do you get any results back when you type If so, try manually putting in your userprincipalname and see if you get any results back
|
Yeah... get-azaduser returns my two users. One is the root account (external, @live.com) and the other one is a IAM user. What happens is: |
The userprincipalname is: So basically the @live.com $username returned above is not equivalent to the UserPrincipalName returned by get-AzADUser |
Ahhhh ok I see what's happening, thank you for finding this, i'll update it right now. |
Glad you see it, as I don't :) I am basically testing some tools on my account for an Azure configuration review I'll have to do in a couple of days :) |
Fixed here: ef6f905 Get-AzContext will erroneously populate the 'id' property without appending #EXT#@tenant.onmicrosoft.com which is why searching via UPN does not return any data, as the id is not a proper UPN. Fixed by fetching the UPN via Graph API call instead of Get-AzContext |
Hmm, getting a different error though: |
First, I connect to my account using my "root" user with connect-azaccount
Then I import Powerzure
PowerZure : Cannot validate argument on parameter 'ObjectId'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again
PowerZure -Checks -Banner -Welcome
CategoryInfo : InvalidData: (:) [PowerZure], ParameterBindingValidationException
FullyQualifiedErrorId : ParameterArgumentValidationError,PowerZure
The text was updated successfully, but these errors were encountered: