Skip to content

SPSite: Microsoft.SharePoint.SPSite Constructur returns $null for site properties (Owner.Email, Rootweb.Template, etc.)Β #1453

@Maurikrm

Description

@Maurikrm

Problem description

After installing the latest version of SharePointDSC 5.6.1. (which includes fix #1443 ) it turns out that some site properties returns $null for HNSC.

Verbose logs

Output WITHOUT the fix:

ConfigurationName        : BGSharePoint_SP
DependsOn                : {[SPWebApplication]SharePoint Content Web Application}
ModuleName               : SharePointDSC
ModuleVersion            : 5.6.1
PsDscRunAsCredential     :
ResourceId               : [SPSite]Site_my.contoso.lab
SourceInfo               :
AdministrationSiteType   : None
CompatibilityLevel       : 15
ContentDatabase          : SP_Content_01
CreateDefaultGroups      : True
Description              :
HostHeaderWebApplication : https://portal.contoso.lab/
Language                 : 1043
Name                     :
OwnerAlias               : contoso\svc-farm
OwnerEmail               :
QuotaTemplate            :
SecondaryEmail           :
SecondaryOwnerAlias      :
Template                 : SPSMSITEHOST#0
Url                      : https://my.contoso.lab
PSComputerName           : WEU-SPSE-BE
CimClassName             : MSFT_SPSite



Output WITH the fix:

ConfigurationName        : BGSharePoint_SP
DependsOn                : {[SPWebApplication]SharePoint Content Web Application}
ModuleName               : SharePointDSC
ModuleVersion            : 5.6.1
PsDscRunAsCredential     :
ResourceId               : [SPSite]Site_my.contoso.lab
SourceInfo               :
AdministrationSiteType   : None
CompatibilityLevel       : 15
ContentDatabase          : SP_Content_01
CreateDefaultGroups      : False
Description              :
HostHeaderWebApplication : https://portal.contoso.lab/
Language                 : 1043
Name                     :
OwnerAlias               :
OwnerEmail               :
QuotaTemplate            :
SecondaryEmail           :
SecondaryOwnerAlias      :
Template                 : #
Url                      : https://my.contoso.lab
PSComputerName           : WEU-SPSE-BE
CimClassName             : MSFT_SPSite

DSC configuration

SPSite $site
{
 Url                      = 'https://my.contoso.lab'
 OwnerAlias               = 'contoso\svc-farm'
 ContentDatabase          = 'SP_Content_01'
 HostHeaderWebApplication = 'https://portal.contoso.lab'
 Name                     = 'MySite'
 Template                 = 'SPSMSITEHOST#0'
 Language                 = '1043'
 PsDscRunAsCredential     = $InstallAccount
 DependsOn                = $depends
}

Suggested solution

.

SharePoint version and build

SharePoint Server Subscription Edition 16.0.18526.20080 (25H1)

Operating system the target node is running

WindowsBuildLabEx                                       : 20348.2849.amd64fre.fe_release_svc_prod1.241101-1732
WindowsCurrentVersion                                   : 6.3
WindowsEditionId                                        : ServerDatacenter
WindowsInstallationType                                 : Server Core
WindowsProductName                                      : Windows Server 2022 Datacenter

PowerShell version and build the target node is running

PSVersion                      5.1.20348.2849
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.20348.2849
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

SharePointDsc version

SharePointDSC 5.6.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions