Office 365 DSC

(WIP)

Let me do some quick PoC on Office 365 DSC in my Office 365 Dev environment…

So far it is not working…

I have created a simple configuration:

Configuration o365DSC_Config_Tenant
{
    param(
        [Parameter(Mandatory = $true)]
        [PSCredential]
        $credsGlobalAdmin
    )
    Import-DscResource -ModuleName Office365DSC
    node localhost
    {
        SPOTenantSettings MyTenantSettings
        {
            IsSingleInstance                              = "Yes"
            GlobalAdminAccount                            = $credsGlobalAdmin
            PublicCdnEnabled                              = $false
            PublicCdnAllowedFileTypes                     = "CSS,EOT,GIF,ICO,JPEG,JPG,JS,MAP,PNG,SVG,TTF,WOFF"
            NotificationsInSharePointEnabled              = $true
            OwnerAnonymousNotification                    = $true
            LegacyAuthProtocolsEnabled                    = $false
            Ensure                                        = "Present"
        }
    }
}

and ran it with

$adminAccountCred = Get-Credential -UserName $adminUPN -Message "pw pls"
$mPath = 'C:\scripts\o365\Office365DSC'
$cd = @{
    AllNodes = @(
        @{
            NodeName = 'localhost'
            PSDscAllowPlainTextPassword = $true
        }
    )
}
o365DSC_Config_Tenant -OutputPath $mPath -credsGlobalAdmin $adminAccountCred -ConfigurationData $cd
Start-DscConfiguration -ComputerName 'localhost' -Wait -Verbose -Path $mPath -Force

the error I got:

VERBOSE: [VPC]:                            [[SPOTenantSettings]MyTenantSettings] Test-TargetResource returned False
VERBOSE: [VPC]: LCM:  [ End    Test     ]  [[SPOTenantSettings]MyTenantSettings]  in 11.4040 seconds.
VERBOSE: [VPC]: LCM:  [ Start  Set      ]  [[SPOTenantSettings]MyTenantSettings]
VERBOSE: [VPC]:                            [[SPOTenantSettings]MyTenantSettings] Setting configuration for SPO Tenant
VERBOSE: [VPC]:                            [[SPOTenantSettings]MyTenantSettings] The use of the public CDN is not enabled, for that the PublicCdnAllowedFileTypes par
ameter can not be configured and will be removed
A parameter cannot be found that matches parameter name 'Ensure'.
    + CategoryInfo          : InvalidArgument: (:) [], CimException
    + FullyQualifiedErrorId : NamedParameterNotFound,SharePointPnP.PowerShell.Commands.Admin.SetTenant
    + PSComputerName        : localhost
 
VERBOSE: [VPC]: LCM:  [ End    Set      ]  [[SPOTenantSettings]MyTenantSettings]  in 3.7290 seconds.
The PowerShell DSC resource '[SPOTenantSettings]MyTenantSettings' with SourceInfo 
'C:\scripts\o365\Office365DSC\o365DSC_Config_Tenant.ps1::12::9::SPOTenantSettings' threw one or more non-terminating errors while running the Set-TargetResource 
functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
    + CategoryInfo          : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : NonTerminatingErrorFromProvider
    + PSComputerName        : localhost
 
VERBOSE: [VPC]: LCM:  [ End    Set      ]
The SendConfigurationApply function did not succeed.
    + CategoryInfo          : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : MI RESULT 1
    + PSComputerName        : localhost
 
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 15.486 seconds

More to come…