Skip to content

Commit

Permalink
Merge pull request #1259 from ykuijs/bugfix
Browse files Browse the repository at this point in the history
Corrected diagnostic logging of credentials
  • Loading branch information
ykuijs committed Nov 13, 2020
2 parents 2731f68 + a8f5081 commit 2677ed9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- SharePointDsc
- Updated Convert-SPDscHashtableToString to output the username when
parameter is a PSCredential
- SPFarm
- Switched from creating a Lock database to a Lock table in the TempDB.
This to allow the use of precreated databases.
- Updated code to properly output used credential parameters to verbose
logging
- SPSite
- Added more explanation to documentation on which parameters are checked
- SPWeb
Expand All @@ -40,7 +45,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed issue where provisioning the service app requires a second run to
update all specified parameters
- SPWorkflowService
- Fixed issue configuring workflow service when no workflow service is currently configured.
- Fixed issue configuring workflow service when no workflow service is
currently configured

## [4.3.0] - 2020-09-30

Expand Down
23 changes: 22 additions & 1 deletion SharePointDsc/DSCResources/MSFT_SPFarm/MSFT_SPFarm.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,20 @@ function Set-TargetResource
{
try
{
Write-Verbose -Message "Connecting to existing Config database"
Write-Verbose -Message "executeArgs is:"
foreach ($arg in $executeArgs.Keys)
{
if ($executeArgs.$arg -is [System.Management.Automation.PSCredential])
{
Write-Verbose -Message "$arg : $($executeArgs.$arg.UserName)"
}
else
{
Write-Verbose -Message "$arg : $($executeArgs.$arg)"
}
}

Connect-SPConfigurationDatabase @executeArgs | Out-Null
$connectedToFarm = $true
}
Expand Down Expand Up @@ -1031,7 +1045,14 @@ function Set-TargetResource
Write-Verbose -Message "executeArgs is:"
foreach ($arg in $executeArgs.Keys)
{
Write-Verbose -Message "$arg $($executeArgs[$arg])"
if ($executeArgs.$arg -is [System.Management.Automation.PSCredential])
{
Write-Verbose -Message "$arg : $($executeArgs.$arg.UserName)"
}
else
{
Write-Verbose -Message "$arg : $($executeArgs.$arg)"
}
}
New-SPConfigurationDatabase @executeArgs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ function Convert-SPDscHashtableToString
{
$str = "$($pair.Key)=$(Convert-SPDscCIMInstanceToString -CIMInstance $pair.Value)"
}
elseif ($pair.Value -is [System.Management.Automation.PSCredential])
{
$str = "$($pair.Key)=$($pair.Value.UserName)"
}
else
{
$str = "$($pair.Key)=$($pair.Value)"
Expand Down

0 comments on commit 2677ed9

Please sign in to comment.