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

issue with SPOUserProfileProperty | SPN | Cannot bind argument to parameter 'Properties' because it is null. #2798

Closed
maheshdalavi opened this issue Jan 17, 2023 · 7 comments · Fixed by #2941 or #2953

Comments

@maheshdalavi
Copy link

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

run the command with

Export-M365DSCConfiguration -Components @("SPOUserProfileProperty") -ApplicationId $ApplicationId -CertificateThumbprint $CertificateThumbprint -TenantId $TenantId -Verbose

  • SPN has Sharepoint = Sites.FullControl.All, Organization.Read.All and other permissions.
  • All components are working fine except SPOUserProfileProperty

Verbose logs showing the problem

image

[2023-01-18 03.25.27]
{InvalidData}
System.Management.Automation.ParameterBindingValidationException: Cannot bind argument to parameter 'Properties' because it is null.
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.23.111.1\DSCResources\MSFT_SPOUserProfileProperty\MSFT_SPOUserProfileProperty.psm1: line 324
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.111.1\modules\M365DSCReverse.psm1: line 615
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.111.1\modules\M365DSCUtil.psm1: line 1190
at , : line 1
TenantId: maheshms365.onmicrosoft.com

Suggested solution to the issue

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

# insert configuration here

The operating system the target node is running

OsName : Microsoft Windows 10 Home Single Language
OsOperatingSystemSKU : 100
OsArchitecture : 64-bit
WindowsVersion : 2009
WindowsBuildLabEx : 19041.1.amd64fre.vb_release.191206-1406
OsLanguage : en-US
OsMuiLanguages : {en-US}

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

@andikrueger andikrueger added Bug Something isn't working SharePoint Online Authentication V1.23.111.1 Version 1.23.111.1 labels Jan 18, 2023
@andikrueger
Copy link
Collaborator

Please have a look at this thread. Within SharePoint you need to assign additional permissions to the app.

pnp/PnP-PowerShell#2582

@jeffreykarlan
Copy link

Please have a look at this thread. Within SharePoint you need to assign additional permissions to the app.

pnp/PnP-PowerShell#2582

Hi,
I'm having this issue. I'm not seeing a clear solution or fix in the suggested thread? Only some hints at a workaround? Is this identified as a bug in MS365DSC Required Application Permissions? Thank you.

@NikCharlebois
Copy link
Collaborator

What provider are you using for the Sites.FullControl.All permissions? This needs to be the SharePoint provider, not the Microsoft Graph one:

image
image

@jeffreykarlan
Copy link

jeffreykarlan commented Feb 6, 2023

Hello,

I'm attempting to export only, no writing. I have https://microsoft.sharepoint-df.com/Sites.Read.All.

image

Ah! Looks like my app needs full control to read? Should this be necessary?
image

Thank you

@maheshdalavi
Copy link
Author

@NikCharlebois Application has SharePoint:Sites.fullControl.all.
along with SPOUserProfileProperty,
Access denied for SPOSiteAuditSettings (Private site) and error in SPOHubSite.
Screenshot 2023-02-07 003701

@NikCharlebois
Copy link
Collaborator

@jeffreykarlan Sites.FullControl.All is a requirement of the SPO APIs even if you are just doing an export.

@NikCharlebois
Copy link
Collaborator

Looks like we were missing a permission for the SPOUserProfileProperty. You will also need to grant:

SharePoint:
User.Read.All

In order of it to work. A fix is in the work to properly document this. Thanks

NikCharlebois added a commit to NikCharlebois/Microsoft365DSC that referenced this issue Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants