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 process aborts if a user account is not found #5703

Open
hrcastro opened this issue Jan 31, 2025 · 0 comments
Open

Export process aborts if a user account is not found #5703

hrcastro opened this issue Jan 31, 2025 · 0 comments

Comments

@hrcastro
Copy link

Description of the issue

When trying to export all user accounts from a tenant with a large amount of accounts, the export process aborts if a user account is not found. I assume the deleted account existed when the process started, but was deleted right after.

Microsoft 365 DSC Version

V1.25.129.2

Which workloads are affected

Azure Active Directory (Entra ID)

The DSC configuration

PS Z:\> Get-Module -ListAvailable | Where-Object { $_.Name -like "*DSC*" }


    Directory: C:\Program Files\WindowsPowerShell\Modules


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Manifest   2.0.0.14   DSCParser                           {ConvertTo-DSCObject, ConvertFrom-DSCObject}
Manifest   1.25.129.2 Microsoft365DSC                     {Assert-M365DSCBlueprint, Compare-M365DSCConfigurations, Confirm-M365DSCDependencies, Export-M365DSCConfiguration...}
Manifest   2.0.0.22   ReverseDSC                          {Get-DSCParamType, Get-DSCBlock, Get-DSCFakeParameters, Get-DSCDependsOnBlock...}

Verbose logs showing the problem

|---[15547/40527] rob.palmxxxxx✅
    |---[15548/40527] lucy.keaxxxxxxx✅
    |---[15549/40527] svc.row1xxxxxxxError Log created at {file://Z:/11300-M365DSC-ErrorLog.log}
❌
Error Log created at {file://Z:/11300-M365DSC-ErrorLog.log}
⌛ Export took {3644 seconds} for {15549 instances}
PS Z:\> cat .\11300-M365DSC-ErrorLog.log
[2025/01/31 12:01:14]
{InvalidOperation}
System.Exception: [Request_ResourceNotFound] : Resource 'svc.row1xxxxxxx' does not exist or one of its queried reference-property objects are not present.
"Error retrieving data:"
at Get-MgUserLicenseDetail<Process>, C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Users\2.25.0\exports\ProxyCmdletDefinitions.ps1: line 5174
at Get-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.129.2\DSCResources\MSFT_AADUser\MSFT_AADUser.psm1: line 194
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.129.2\DSCResources\MSFT_AADUser\MSFT_AADUser.psm1: line 1095
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.129.2\Modules\M365DSCReverse.psm1: line 689
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.129.2\Modules\M365DSCUtil.psm1: line 1512
at <ScriptBlock>, <No file>: line 1
TenantId: xxxxx.onmicrosoft.com



[2025/01/31 12:01:14]
{InvalidOperation}
System.Management.Automation.RuntimeException: The property 'Password' cannot be found on this object. Verify that the property exists and can be set.
   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
   at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
"Error during Export:"
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.129.2\DSCResources\MSFT_AADUser\MSFT_AADUser.psm1: line 1096
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.129.2\Modules\M365DSCReverse.psm1: line 689
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.129.2\Modules\M365DSCUtil.psm1: line 1512
at <ScriptBlock>, <No file>: line 1
TenantId: xxxxx.onmicrosoft.com

Environment Information + PowerShell Version

PS Z:\> Get-ComputerInfo -Property @(
>> 'OsName',
>> 'OsOperatingSystemSKU',
>> 'OSArchitecture',
>> 'WindowsVersion',
>> 'WindowsBuildLabEx',
>> 'OsLanguage',
>> 'OsMuiLanguages')


OsName               : Microsoft Windows 11 Enterprise
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture       : ARM 64-bit Processor
WindowsVersion       : 2009
WindowsBuildLabEx    : 26100.1.arm64fre.ge_release.240331-1435
OsLanguage           : en-GB
OsMuiLanguages       : {en-GB}



PS Z:\>
PS Z:\> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.26100.2161
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.26100.2161
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
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

1 participant