Skip to content

Commit

Permalink
fix: Add-vCenterGlobalPermission (#376)
Browse files Browse the repository at this point in the history
Fixed `Add-vCenterGlobalPermission` where `-localDomain` switch was always set to `false`.

Signed-off-by: Gary Blake <gblake@vmware.com>
  • Loading branch information
GaryJBlake authored Oct 16, 2023
1 parent 8fce37f commit 2b05926
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion PowerValidatedSolutions.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'PowerValidatedSolutions.psm1'

# Version number of this module.
ModuleVersion = '2.7.0.1014'
ModuleVersion = '2.7.0.1015'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
6 changes: 3 additions & 3 deletions PowerValidatedSolutions.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -13348,14 +13348,14 @@ Function Add-vCenterGlobalPermission {
[Parameter (Mandatory = $true)] [ValidateNotNullOrEmpty()] [String]$role,
[Parameter (Mandatory = $true)] [ValidateSet("true", "false")] [String]$propagate,
[Parameter (Mandatory = $true)] [ValidateSet("group", "user")] [String]$type,
[Parameter (Mandatory = $false)] [Switch]$localDomain = $false
[Parameter (Mandatory = $false)] [Switch]$localDomain
)

Try {
if (!$localDomain){
if (!$localDomain) {
$checkAdAuthentication = Test-ADAuthentication -user $domainBindUser -pass $domainBindPass -server $domain -domain $domain -ErrorAction SilentlyContinue
$securePass = ConvertTo-SecureString -String $domainBindPass -AsPlainText -Force
$domainCreds = New-Object System.Management.Automation.PSCredential ($domainBindUser, $securePass)
$domainCreds = New-Object System.Management.Automation.PSCredential ($domainBindUser, $securePass)
if (!($checkAdAuthentication[1] -match "Authentication Successful")) {
Write-Error "Unable to authenticate to Active Directory with user ($domainBindUser) and password ($domainBindPass), check details: PRE_VALIDTION_FAILED"
Return
Expand Down
2 changes: 0 additions & 2 deletions SampleScripts/iam/iamConfigureNsx.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ Try {
$pvsModulePath = (Get-InstalledModule -Name PowerValidatedSolutions).InstalledLocation
$allWorkloadDomains = Get-VCFWorkloadDomain
$domainFqdn = $pnpWorkbook.Workbook.Names["region_ad_child_fqdn"].Value
$domainBindUser = $pnpWorkbook.Workbook.Names["child_svc_vsphere_ad_user"].Value
$domainBindPass = $pnpWorkbook.Workbook.Names["child_svc_vsphere_ad_password"].Value
$mgmtSddcDomainName = $pnpWorkbook.Workbook.Names["mgmt_sddc_domain"].Value
$wldSddcDomainName = $pnpWorkbook.Workbook.Names["wld_sddc_domain"].Value
$wsaFqdn = $pnpWorkbook.Workbook.Names["region_wsa_fqdn"].Value
Expand Down

0 comments on commit 2b05926

Please sign in to comment.