Skip to content

Commit

Permalink
Fix for issue microsoft#88
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayode Bristol authored and Kayode Bristol committed Dec 9, 2019
2 parents 4d94578 + 6f8eed0 commit 55708cc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,5 @@ ReverseDSC can be used for many reasons, including:

# How to Contribute?
Please refer to the follow Wiki page if you are interested in contributing to the project: https://github.com/Microsoft/SharePointDSC.Reverse/wiki/Contribute-to-an-Orchestrator-Script


13 changes: 4 additions & 9 deletions SharePointDSC.Reverse.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* Fixed issue with Central admin Port retrieval;
* Updated dependency to ReverseDSC 1.9.4.7;
* Updated dependency to SharePointDSC 3.6.0.0;
* Fixed issue #90 incorrect handling of Port in Read-SPWebapplications;
* Fixed issue #92 | Fails to handle Farms with multiple SQL Server instances;
#>

Expand Down Expand Up @@ -1266,11 +1268,7 @@ function Read-SPWebApplications (){

Add-ConfigurationDataEntry -Node "NonNodeData" -Key "DatabaseServer" -Value $results.DatabaseServer -Description "Name of the Database Server associated with the destination SharePoint Farm;"
$results.DatabaseServer = "`$ConfigurationData.NonNodeData.DatabaseServer"
if($results.WebAppURl.Contains(":") -and $results.Port -and $results.Port -ne 80)
{
$results.Remove("Port")
}
elseif(!$results.WebAppUrl.Contains(":") -and !$results.Port)
if(!$results.WebAppUrl.Contains(":") -and !$results.Port)
{
$results.Add("Port", 80)
}
Expand Down Expand Up @@ -3442,10 +3440,7 @@ function Read-SPContentDatabase()
$params.WebAppUrl = $spContentDB.WebApplication.Url
$results = Get-TargetResource @params
$results = Repair-Credentials -results $results

Add-ConfigurationDataEntry -Node "NonNodeData" -Key "DatabaseServer" -Value $results.DatabaseServer -Description "Name of the Database Server associated with the destination SharePoint Farm;"
$results.DatabaseServer = "`$ConfigurationData.NonNodeData.DatabaseServer"

$results.DatabaseServer = $spContentDB.Server
$currentBlock = Get-DSCBlock -UseGetTargetResource -Params $results -ModulePath $module
$currentBlock = Convert-DSCStringParamToVariable -DSCBlock $currentBlock -ParameterName "DatabaseServer"
$Script:dscConfigContent += $currentBlock
Expand Down
6 changes: 5 additions & 1 deletion SharePointDSC.Reverse.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,11 @@ function Read-SPFarm (){
$caAuthMethod = "Kerberos"
}
$params.CentralAdministrationAuth = $caAuthMethod
$params.CentralAdministrationPort = $Script:spCentralAdmin.IisSettings[0].SecureBindings.Port
$params.CentralAdministrationPort = $Script:spCentralAdmin.IisSettings[0].ServerBindings.Port
if($null -eq $params.CentralAdministrationPort -or $params.CentralAdministrationPort -eq 0)
{
$params.CentralAdministrationPort = $Script:spCentralAdmin.IisSettings[0].SecureBindings.Port
}
$params.FarmAccount = $Global:spFarmAccount
$params.Passphrase = $Global:spFarmAccount
$results = Get-TargetResource @params
Expand Down

0 comments on commit 55708cc

Please sign in to comment.