question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting error with "Administrators" security type in SPServiceAppSecurity

See original GitHub issue

Details of the scenario you try and problem that is occurring: I’m trying to execute this code:

Configuration Example 
{
    param(
        [Parameter(Mandatory = $true)]
        [PSCredential]
        $SetupAccount
    )
    Import-DscResource -ModuleName SharePointDsc

    node localhost {
        $membersToInclude = @()
        $membersToInclude += MSFT_SPServiceAppSecurityEntry {
                                Username    = "CONTOSO\SharePointFarmAccount"
                                AccessLevel = "Full Control"
                            }
        $membersToInclude += MSFT_SPServiceAppSecurityEntry {
                                Username    = "CONTOSO\SharePointServiceApps"
                                AccessLevel = "Full Control"
                            }
        SPServiceAppSecurity UserProfileServiceSecurity
        {
            ServiceAppName       = "User Profile Service Application"
            SecurityType = "Administrators"
            Members  = $membersToInclude
            PsDscRunAsCredential = $SetupAccount 
        }
    }
}

I’m receiving the following error:

Cannot bind argument to parameter 'ReferenceObject' because it is null.
    + CategoryInfo          : InvalidData: (:) [], CimException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.CompareObje
   ctCommand

When I look in the MOF file, I can see that there is no empty value. Everything is well populated. Perhaps I’m doing something wrong but I don’t see what. I didn’t try to use ‘MembersToInclude’ and use ‘Members’ instead because I want to make sure that only the list provided is admin on the service and no one else.

Version of the Operating System and PowerShell the DSC Target Node is running: Windows Server 2016 with SharePoint 2016

Version of the DSC module you’re using: 1.7.0.0

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
wickedavecommented, Jul 27, 2017

@BrianFarnhill Sure. I will open another issue for the “doing nothing” matter. Thanks

0reactions
ykuijscommented, May 30, 2018

I guess this is registered in issue #641, which is still open.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Errors when connecting to SharePoint Online Management ...
Describes how to resolve connectivity problems to SharePoint Online Management Shell.
Read more >
Error: Access Denied (Including Site Collection Admins) for ...
I have fixed the issue by running Powershell command and site is working fine now. $wa = Get-SPWebApplication -Identity ...
Read more >
cannot contact web site or the web site does not support ...
Problem : When trying to connect to SharePoint Online through PowerShell script, I got this error message “Cannot contact web site ...
Read more >
asp.net - strange IIS authorization issue for administrator
This seems to be saying that the client is not being authorised as their Windows account. This seems to be the area to...
Read more >
Security Token Service not available - sharepoint2013admin
In the Application Pools list, right-click SecurityTokenServiceApplicationPool, and then click Start. If the application pool is started already ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found