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

IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10: Error in catch block overwrites/hides original error? #4781

Open
commandcom opened this issue Jun 21, 2024 · 0 comments
Labels
Bug Something isn't working Intune

Comments

@commandcom
Copy link

Description of the issue

  • Run Test-DscConfiguration on mof/resource in title
    • Returns error: "Cannot bind argument to parameter 'BoundParameters' because it is null"
  • Test-DscConfiguration calls the Get-TargetResource function
    • The entire function is covered in a try/catch block
    • The catch block passes a variable named: $nullResult to the Clear-M365DSCAuthenticationParameter
    • Clear-M365DSCAuthenticationParameter does not accept nulls for the BoundParameters parameter:

image

  • What seems to be happening:
    • An error occurs before the $nullResult variable gets set
    • Catch block picks up the error and passes the uninitialized $nullResult to Clear-M365DSCAuthenticationParameter
    • The parameter validation in Clear-M365DSCAuthenticationParameter throws the error

image

image

  • In our scenario, the assumption is we're getting a permission error in the call to Graph, resulting in the "BoundParameters" error
  • I cannot step through the code to prove this is what is actually happening
  • But on paper, this seems like a plausible explanation as to the root cause
  • Happy to answer any questions you might have

Microsoft 365 DSC Version

1.24.424.1

Which workloads are affected

Intune

The DSC configuration

No response

Verbose logs showing the problem

No response

Environment Information + PowerShell Version

OsName               : Microsoft Windows Server 2019 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture       : 64-bit
WindowsVersion       : 1809
WindowsBuildLabEx    : 17763.1.amd64fre.rs5_release.180914-1434
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

Key   : PSVersion
Value : 5.1.17763.5933
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.17763.5933
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
@andikrueger andikrueger added Bug Something isn't working Intune labels Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Intune
Projects
None yet
Development

No branches or pull requests

2 participants