You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Details of the scenario you try and problem that is occurring:
When running on Farms with multiple SQL Server instances, script only captures first database server name.
The DSC configuration that is using the resource: MSFT_SPContentDatabase
Version of the DSC module you're using: 3.6.0.0
Suggested fix:
functionRead-SPContentDatabase()
{
$module=Resolve-Path ($Script:SPDSCPath+"\DSCResources\MSFT_SPContentDatabase\MSFT_SPContentDatabase.psm1")
Import-Module$module$params=Get-DSCFakeParameters-ModulePath $module$spContentDBs=Get-SPContentDatabase$i=1$total=$spContentDBs.Lengthforeach($spContentDBin$spContentDBs)
{
try
{
$dbName=$spContentDB.NameWrite-Host"Scanning Content Database [$i/$total] {$dbName}"$Script:dscConfigContent+=" SPContentDatabase "+$spContentDB.Name.Replace("","") +"`r`n"$Script:dscConfigContent+=" {`r`n"$params.Name=$dbName$params.WebAppUrl=$spContentDB.WebApplication.Url$results=Get-TargetResource@params$results=Repair-Credentials-results $results<# Incorrectly assumes single SQL Server Add-ConfigurationDataEntry -Node "NonNodeData" -Key "$($dbName)_DatabaseServer" -Value $spContentDB.Server -Description "Name of the Database Server associated with the destination SharePoint Farm;" $dbServerName = "`$ConfigurationData.NonNodeData.$($dbName)_DatabaseServer"#>#Capture the actual SQL Database Server associated with the Content Database$results.DatabaseServer=$spContentDB.Server$currentBlock=Get-DSCBlock-UseGetTargetResource -Params $results-ModulePath $module$currentBlock=Convert-DSCStringParamToVariable-DSCBlock $currentBlock-ParameterName "DatabaseServer"$Script:dscConfigContent+=$currentBlock$Script:dscConfigContent+=" }`r`n"$i++
}
catch
{
$Script:ErrorLog+="[Content Database]"+$spContentDB.Name+"`r`n"$Script:ErrorLog+="$_`r`n`r`n"
}
}
}
The text was updated successfully, but these errors were encountered:
kayodebristol
pushed a commit
to kayodebristol/SharePointDSC.Reverse
that referenced
this issue
Nov 12, 2019
Details of the scenario you try and problem that is occurring:
When running on Farms with multiple SQL Server instances, script only captures first database server name.
The DSC configuration that is using the resource: MSFT_SPContentDatabase
Version of the DSC module you're using: 3.6.0.0
Suggested fix:
The text was updated successfully, but these errors were encountered: