microsoft / Microsoft365DSC

Manages, configures, extracts and monitors Microsoft 365 tenant configurations
https://aka.ms/M365DSC
MIT License
1.53k stars 469 forks source link

Unable to Export AADgroup(s) #4435

Open chield opened 5 months ago

chield commented 5 months ago

Description of the issue

Hello,

I'm trying to run this command: Export-M365DSCConfiguration -Components AADGroup -Credential (Get-Credential) -Path C:\M365DSC -FileName "AAD_Groups" -Verbose -Debug

Authentication is working fine, in the log the following message will be showed: "Error during Export:" at Get-MgGroup, C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Groups\2.15.0\exports\ProxyCmdletDefinitions.ps1: line 45179 at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.228.1\DSCResources\MSFT_AADGroup\MSFT_AADGroup.psm1: line 1114 at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.228.1\Modules\M365DSCReverse.psm1: line 649 at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.228.1\Modules\M365DSCUtil.psm1: line 1357 at , : line 2

Could anybody help me to get this fixed?

Thanks!

Microsoft 365 DSC Version

1.24.228.1

Which workloads are affected

Azure Active Directory

The DSC configuration

Export-M365DSCConfiguration -Components AADGroup -Credential (Get-Credential) -Path C:\M365DSC -FileName "AAD_Groups" -Verbose -Debug

Verbose logs showing the problem

VERBOSE: Removing the imported "Test-TargetResource" function.
VERBOSE: Removing the imported "Set-TargetResource" function.
VERBOSE: Removing the imported "Get-TargetResource" function.
VERBOSE: Removing the imported "Export-TargetResource" function.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.228.1\DSCResources\MSFT_AADGroup\MSFT_AADGroup.psm1'.
VERBOSE: Importing function 'Export-TargetResource'.
VERBOSE: Importing function 'Get-TargetResource'.
VERBOSE: Importing function 'Set-TargetResource'.
VERBOSE: Importing function 'Test-TargetResource'.
Connecting to {MicrosoftGraph}...✅
[1/1] Extracting [AADGroup] 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.
❌
 Error Log created at {file://C:/VSCode/Templates_2022/4824-M365DSC-ErrorLog.log}

Environment Information + PowerShell Version

OsName               : Microsoft Windows 11 Pro
OsOperatingSystemSKU : 48
OsArchitecture       : ARM 64-bit Processor
WindowsVersion       : 2009
WindowsBuildLabEx    : 26058.1000.arm64fre.ge_release.240209-1555
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

Key   : PSVersion
Value : 5.1.26058.1000
Name  : PSVersion

Key   : PSEdition
Value : Desktop
Name  : PSEdition

Key   : PSCompatibleVersions
Value : {1.0, 2.0, 3.0, 4.0...}
Name  : PSCompatibleVersions

Key   : BuildVersion
Value : 10.0.26058.1000
Name  : BuildVersion

Key   : CLRVersion
Value : 4.0.30319.42000
Name  : CLRVersion

Key   : WSManStackVersion
Value : 3.0
Name  : WSManStackVersion

Key   : PSRemotingProtocolVersion
Value : 2.3
Name  : PSRemotingProtocolVersion

Key   : SerializationVersion
Value : 1.1.0.1
Name  : SerializationVersion
NikCharlebois commented 5 months ago

There have been updates to this resource in the past releases. Can you please update to the latest version and confirm whether or not this issue still persists? Thanks