dsccommunity / SharePointDsc

The SharePointDsc PowerShell module provides DSC resources that can be used to deploy and manage a SharePoint farm
MIT License
247 stars 107 forks source link

[SPShellAdmins] is casesensitive on the Members #1439

Closed ChristophHannappel closed 2 days ago

ChristophHannappel commented 1 week ago

Problem description

Create an ADGroup with the Accountname "UPERCASEGROUP".
Create a SPShellAdmins Ressource and type the Name in lower case or at least one character in lower case. The Test Method will fail.

Verbose logs

-

DSC configuration

SPShellAdmins ShellAdmins
        {
            IsSingleInstance = "Yes"
            Members          = "CONTOSO\upercasegroup"
            AllDatabases     = $true
        }

Suggested solution

The Line 1167 if (-not($CurrentValues.Members.Contains($member))) should use the PowerShell -contains Operator which is caseinsenitive instead of the casesensitive .Net .contains() Method.

SharePoint version and build

SharePoint Server Subscription Edition 16.0.17928.20238

Operating system the target node is running

@{
OsName=Microsoft Windows Server 2022 Datacenter; 
OsOperatingSystemSKU=DatacenterServerEdition; 
OsArchitecture=64-bit; 
WindowsVersion=2009; 
WindowsBuildLabEx=20348.1.amd64fre.fe_release.210507-1500; 
OsLanguage=en-US; 
OsMuiLanguages=System.String[]
}

PowerShell version and build the target node is running

Name                           Value                                                                                                                                                                                   
----                           -----                                                                                                                                                                                   
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

Name          Version Path                                                                             
----          ------- ----                                                                             
SharePointDSC 5.4.0   C:\Program Files\WindowsPowerShell\Modules\SharePointDSC\5.4.0\SharePointDSC.psd1
ChristophHannappel commented 1 week ago

I'm working on a fix and will start a PR when it's ready.

ykuijs commented 2 days ago

Closed via PR #1440