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

Export-M365DSCConfiguration with Service Principal/Secret authentication method not determined #2396

Closed
essjaywilson opened this issue Oct 13, 2022 · 2 comments
Labels

Comments

@essjaywilson
Copy link

essjaywilson commented Oct 13, 2022

Details of the scenario you tried and the problem that is occurring

Before updating the module to the latest version, I could successfully export selected config using, for example:

Export-M365DSCConfiguration -Components @("AADNamedLocationPolicy") -ApplicationId $ApplicationId -TenantId $TenantId -ApplicationSecret $ApplicationSecret

Now, when I run the exact same cmdlet, the code returns 2 things:

  1. Authentication methods specified: - Service Principal with Application Secret
  2. Could not determine authentication method

I can run the same cmdlet using -Credential $credential but this was not required before.

Verbose logs showing the problem

A failed run goes as follows:

_PS C:\WINDOWS\system32> Export-M365DSCConfiguration -Components @("SPOHomeSite") -ApplicationId $ApplicationId -TenantId $TenantId -ApplicationSecret $ApplicationSecret

Exporting Microsoft 365 configuration for Components: SPOHomeSite

Authentication methods specified:

  • Service Principal with Application Secret

Could not determine authentication method
Partial Export file was saved at: C:\Users\xxxxxx\AppData\Local\Temp\3a5a5c01-c7b8-4da9-a07a-4ec2ff35029e.partial.ps1_

A successful run goes as follows:

_PS C:\WINDOWS\system32> Export-M365DSCConfiguration -Components @("AADNamedLocationPolicy") -Credential $credential

Exporting Microsoft 365 configuration for Components: AADNamedLocationPolicy

Authentication methods specified:

  • Credentials

Connecting to {MicrosoftGraph}...✅
[1/1] Extracting [AADNamedLocationPolicy] using {Credentials}...
|---[1/5] Rxxxxxx✅
|---[2/5] Sxxxxx]✅
|---[3/5] [Mxxxxxx✅
|---[4/5] [Mxxxxxxxxxxxxx✅
|---[5/5] Test✅
⌛ Export took {26 seconds}

Destination Path:_

Suggested solution to the issue

N/A

The DSC configuration that is used to reproduce the issue (as detailed as possible)

The operating system the target node is running

OsName : Microsoft Windows 10 Enterprise
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture : 64-bit
WindowsVersion : 2009
WindowsBuildLabEx : 19041.1.amd64fre.vb_release.191206-1406
OsLanguage : en-GB
OsMuiLanguages : {en-GB, en-US}

Version of the DSC module that was used ('dev' if using current dev branch)

1.22.1005.1

@andikrueger
Copy link
Collaborator

Duplicate of #2379 and #2374. Fix will be released with today's version of M365DSC'.

@andikrueger
Copy link
Collaborator

Linking release PR #2395

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

No branches or pull requests

2 participants