Open ccullum opened 1 year ago
It looks like the latest release of Microsoft365DSC is requiring a number of Microsoft.Graph.* modules to be at 2.7.0. It seems all of these dependent modules can be updated to this release except Microsoft.Graph.Authentication and Microsoft.Graph.Applications which show on the PowerShell page that the code level 2.7.0 was retracted by the owner. Do you know when these will be updated?
https://www.powershellgallery.com/packages/Microsoft.Graph.Applications/2.7.0 https://www.powershellgallery.com/packages/Microsoft.Graph.Authentication/2.7.0
Please try to run the following cmdlet to update your dependencies:
Update-M365DSCDependencies -force
Uninstall-M365DSCOutdatedDependencies
Hi @andikrueger , I updated and uninstalled as instructed. I ran the export again, but it looks like it failed again with the same error:
Command Export-M365DSCConfiguration -Components @("O365OrgSettings") -Credential $Credential -Path 'C:\Users\user1\OneDrive\Desktop\O365' -FileName 'O365.ps1' -Verbose
Output Exporting Microsoft 365 configuration for Components: O365OrgSettings
Authentication methods specified:
VERBOSE: Removing the imported "Export-TargetResource" function. VERBOSE: Removing the imported "Get-TargetResource" function. VERBOSE: Removing the imported "Set-TargetResource" function. VERBOSE: Removing the imported "Test-TargetResource" function. VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.1011.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1'. VERBOSE: Importing function 'Export-TargetResource'. VERBOSE: Importing function 'Get-TargetResource'. VERBOSE: Importing function 'Set-TargetResource'. VERBOSE: Importing function 'Test-TargetResource'. Connecting to {ExchangeOnline}...Error Acquiring Token: AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access '00000002-0000-0ff1-ce00-000000000000'. Trace ID: 05418e65-c9b7-4401-9e49-1fa39fa36300 Correlation ID: a44e6eb4-77b1-43ee-859f-9c60fdc3f217 Timestamp: 2023-10-16 14:55:10Z ✅ [1/1] Extracting [O365OrgSettings] using {Credentials}...VERBOSE: Attempting connection to {MicrosoftGraph} with: VERBOSE: Name Value
Credential System.Management.Automation.PSCredential
VERBOSE: Dependencies were already successfully validated. VERBOSE: Credential was specified. Connecting via User Principal VERBOSE: Dependencies were already successfully validated. VERBOSE: Attempting connection to {MicrosoftGraph} with: VERBOSE: Name Value
TenantId
ManagedIdentity False
IsSingleInstance Yes
ApplicationSecret
Credential System.Management.Automation.PSCredential
ApplicationId
CertificateThumbprint
VERBOSE: Dependencies were already successfully validated. VERBOSE: Credential was specified. Connecting via User Principal VERBOSE: Attempting connection to {Tasks} with: VERBOSE: Name Value
TenantId
ManagedIdentity False
IsSingleInstance Yes
ApplicationSecret
Credential System.Management.Automation.PSCredential
ApplicationId
CertificateThumbprint
VERBOSE: Dependencies were already successfully validated. VERBOSE: Credential was specified. Connecting via User Principal ❌ Error Log created at {file://C:/Users/user1/OneDrive/Desktop/O365/6008-M365DSC-ErrorLog.log} ⌛ Export took {11 seconds}
Log
[2023/10/16 07:55:21]
{InvalidOperation}
System.Net.WebException: The remote server returned an error: (400) Bad Request.
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
"Error during Export:"
at Connect-MSCloudLoginTasksWithUser, C:\Program Files\WindowsPowerShell\Modules\MSCloudLoginAssistant\1.0.121\Workloads\Tasks.psm1: line 42
at Connect-MSCloudLoginTasks, C:\Program Files\WindowsPowerShell\Modules\MSCloudLoginAssistant\1.0.121\Workloads\Tasks.psm1: line 14
at Connect, C:\Program Files\WindowsPowerShell\Modules\MSCloudLoginAssistant\1.0.121\ConnectionProfile.psm1: line 572
at Connect-M365Tenant, C:\Program Files\WindowsPowerShell\Modules\MSCloudLoginAssistant\1.0.121\MSCloudLoginAssistant.psm1: line 335
at New-M365DSCConnection, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.1011.1\modules\M365DSCUtil.psm1: line 1745
at Get-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.1011.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 156
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.1011.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 1045
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.1011.1\modules\M365DSCReverse.psm1: line 615
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.1011.1\modules\M365DSCUtil.psm1: line 1312
at
Hi @andikrueger, I tried updating again today: PS C:\Users\Me\OneDrive\PS-Online> Update-M365DSCDependencies -force Installing DSCParser version {1.3.0.10} Installing ExchangeOnlineManagement version {3.4.0} Installing Microsoft.Graph.Applications version {2.7.0} Installing Microsoft.Graph.Authentication version {2.7.0} Installing Microsoft.Graph.Beta.DeviceManagement version {2.7.0} Installing Microsoft.Graph.Beta.Devices.CorporateManagement version {2.7.0} Installing Microsoft.Graph.Beta.DeviceManagement.Administration version {2.7.0} Installing Microsoft.Graph.Beta.DeviceManagement.Enrollment version {2.7.0} Installing Microsoft.Graph.Beta.Identity.DirectoryManagement version {2.7.0} Installing Microsoft.Graph.Beta.Identity.Governance version {2.7.0} Installing Microsoft.Graph.Beta.Identity.SignIns version {2.7.0} Installing Microsoft.Graph.Beta.Reports version {2.7.0} Installing Microsoft.Graph.Beta.Teams version {2.7.0} Installing Microsoft.Graph.DeviceManagement.Administration version {2.7.0} Installing Microsoft.Graph.Beta.DirectoryObjects version {2.7.0} Installing Microsoft.Graph.Groups version {2.7.0} Installing Microsoft.Graph.Planner version {2.7.0} Installing Microsoft.Graph.Users version {2.7.0} Installing Microsoft.Graph.Users.Actions version {2.7.0} Installing Microsoft.PowerApps.Administration.PowerShell version {2.0.177} Installing MicrosoftTeams version {5.6.0} Installing MSCloudLoginAssistant version {1.0.121} Installing PnP.PowerShell version {1.12.0} Installing ReverseDSC version {2.0.0.18} PS C:\Users\Me\OneDrive\PS-Online> Uninstall-M365DSCOutdatedDependencies Checking Microsoft.Graph.Authentication PS C:\Users\Me\OneDrive\PS-Online>
Here is the command: Export-M365DSCConfiguration -Components @("O365OrgSettings") -Credential $CredMSD -Path 'C:\M365DSC\MSD\O365' -FileName 'msdO365.ps1'
Here is the output: Exporting Microsoft 365 configuration for Components: O365OrgSettings
Authentication methods specified:
Connecting to {ExchangeOnline}...Error Acquiring Token: AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access '00000002-0000-0ff1-ce00-000000000000'. Trace ID: 22a7ed9a-f17f-435b-8609-4a5861c03800 Correlation ID: 8494a3f8-7b83-4d48-873e-5c44c3b2c4fa Timestamp: 2023-10-26 14:59:55Z ✅ [1/1] Extracting [O365OrgSettings] using {Credentials}...❌ Error Log created at {file://C:/M365DSC/MSD/O365/19964-M365DSC-ErrorLog.log} ⌛ Export took {89 seconds}
Here is the content of the log:
[2023/10/26 08:01:14]
{InvalidOperation}
System.Net.WebException: The remote server returned an error: (400) Bad Request.
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
"Error during Export:"
at Connect-MSCloudLoginTasksWithUser, C:\Program Files\WindowsPowerShell\Modules\MSCloudLoginAssistant\1.0.121\Workloads\Tasks.psm1: line 42
at Connect-MSCloudLoginTasks, C:\Program Files\WindowsPowerShell\Modules\MSCloudLoginAssistant\1.0.121\Workloads\Tasks.psm1: line 14
at Connect, C:\Program Files\WindowsPowerShell\Modules\MSCloudLoginAssistant\1.0.121\ConnectionProfile.psm1: line 572
at Connect-M365Tenant, C:\Program Files\WindowsPowerShell\Modules\MSCloudLoginAssistant\1.0.121\MSCloudLoginAssistant.psm1: line 335
at New-M365DSCConnection, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.1025.1\modules\M365DSCUtil.psm1: line 1754
at Get-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.1025.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 156
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.1025.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 1045
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.1025.1\modules\M365DSCReverse.psm1: line 615
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.1025.1\modules\M365DSCUtil.psm1: line 1321
at
Description of the issue
When trying to export O365OrgSettings on multiple tenants, I am getting error: System.Net.WebException: The remote server returned an error: (400) Bad Request.
The command I am using: Export-M365DSCConfiguration -Components @("O365AdminAuditLogConfig", "O365OrgCustomizationSetting", "O365OrgSettings", "O365SearchAndIntelligenceConfigurations") -Credential $Credential2 -Path 'C:\Users\user1\OneDrive\Desktop\O365' -FileName 'O365.ps1' -Verbose
Microsoft 365 DSC Version
Current as of today.
Which workloads are affected
Office 365 Admin
The DSC configuration
No response
Verbose logs showing the problem
Environment Information + PowerShell Version