Skip to content
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

Error Running Connect-Maester -service all #261

Closed
grumpykiwi opened this issue Jun 21, 2024 · 8 comments
Closed

Error Running Connect-Maester -service all #261

grumpykiwi opened this issue Jun 21, 2024 · 8 comments

Comments

@grumpykiwi
Copy link

On a brand new install of windows server 2022, domain joined with windows update, I followed the instructions to setup maester from scratch.

Got all the way to the above command, before it threw an error. Straight after I ran the command, I was prompted for MFA which seemed to work ok. Then the error appeared

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows PS C:\Windows\system32> Install-Module Pester -SkipPublisherCheck -Force -Scope CurrentUser NuGet provider is required to continue PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or 'C:\Users\mnash\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by running 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install and import the NuGet provider now? [Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y
PS C:\Windows\system32> Install-Module Maester -Scope CurrentUser

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its
InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): a
PS C:\Windows\system32> Install-Module Az -Scope CurrentUser

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its
InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): a
PS C:\Windows\system32> Install-Module ExchangeOnlineManagement -Scope CurrentUser

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its
InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): a
PS C:\Windows\system32> cd
PS C:> md maester-tests

Directory: C:\

Mode LastWriteTime Length Name


d----- 6/21/2024 1:40 PM maester-tests

PS C:> cd maester-tests
PS C:\maester-tests> Install-MaesterTests .\tests
Maester tests installed successfully!
Run Connect-Maester to sign in and then run Invoke-Maester to start testing.
PS C:\maester-tests> Connect-Maester -Service All
Please select the account you want to login with.

WARNING: Unable to acquire token for tenant 'organizations' with error 'InteractiveBrowserCredential authentication
failed: Entry point was not found.'
WARNING: Please run 'Connect-AzAccount -DeviceCode' if browser is not supported in this session.
Connect-AzAccount : InteractiveBrowserCredential authentication failed: Entry point was not found.
At C:\Users\mnash\Documents\WindowsPowerShell\Modules\Maester\0.0.131\public\Connect-Maester.ps1:59 char:7

  •   Connect-AzAccount -SkipContextPopulation -UseDeviceAuthenticati ...
    
  •   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : CloseError: (:) [Connect-AzAccount], AuthenticationFailedException
    • FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand

Connect-ExchangeOnline : A parameter cannot be found that matches parameter name 'Device'.
At C:\Users\mnash\Documents\WindowsPowerShell\Modules\Maester\0.0.131\public\Connect-Maester.ps1:65 char:49

  •   Connect-ExchangeOnline -ShowBanner:$false -Device:$UseDeviceCod ...
    
  •                                             ~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [Connect-ExchangeOnline], ParameterBindingException
    • FullyQualifiedErrorId : NamedParameterNotFound,Connect-ExchangeOnline

PS C:\maester-tests>

Any ideas

@soulemike
Copy link
Contributor

soulemike commented Jun 21, 2024

Thanks for sharing this detail @grumpykiwi.

For this issue, please try disabling WAM authentication in the Az module or roll back to a earlier version than Az.Accounts 3.0.0.

Connect-AzAccount : InteractiveBrowserCredential authentication failed: Entry point was not found.

Azure/azure-powershell#25005 (comment)

For this issue, please try using PowerShell 7. It looks like that parameter is only available for the module when in PowerShell 7. We will need to add more handling in the connect cmdlet for these scenarios.

Connect-ExchangeOnline : A parameter cannot be found that matches parameter name 'Device'.

https://learn.microsoft.com/en-us/powershell/module/exchange/connect-exchangeonline?view=exchange-ps#-device

@grumpykiwi
Copy link
Author

grumpykiwi commented Jun 22, 2024 via email

@soulemike
Copy link
Contributor

Glad to hear it is working! Definitely reach out if more challenges crop up. Good ideas too, I think we are beginning to plan around remediation items, but that will definitely be a big lift.

@grumpykiwi
Copy link
Author

grumpykiwi commented Jun 24, 2024 via email

@soulemike
Copy link
Contributor

If you have followed the Learn walkthrough, then I would say most commonly it is an attribute mismatch. Depending on your PKI that could also introduce some wildcards. You could trial Cloud PKI just to simplify the architecture a step further.

https://learn.microsoft.com/en-us/entra/identity/authentication/how-to-certificate-based-authentication

@grumpykiwi
Copy link
Author

grumpykiwi commented Jun 25, 2024 via email

@soulemike
Copy link
Contributor

Typically you'd want to have a device management tool like Intune proxy (Registration Authority) the request and get a signed cert back from your CA, the Intune Connector can do that or you can do Cloud PKI. For just testing then manually copying the PFX to the client's appropriate authentication store and making sure the CA is in the proper trust container if you are domain joined. Then it should be made available. A lot of different components to making CBA work.

@grumpykiwi
Copy link
Author

grumpykiwi commented Jun 25, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants