function Invoke-DatabaseConfigurationAlkamiTenantTask { [CmdletBinding()] param ( [string[]]$TenantGuid ) $logLead = Get-LogLeadName $connectionString = Get-MasterConnectionString # Get tenants for adding service accounts $fullTenants = (Get-FullTenantListFromServer $connectionString) $tenants = $fullTenants Write-Host "$logLead : get tenants" if (-not (Test-IsCollectionNullOrEmpty -Collection $TenantGuid)) { Write-Host "$logLead : filter tenants because tenants were passed in" $tenants = $fullTenants.Where({ $_.BankGuid.ToString() -in $TenantGuid }) } # Add the service accounts foreach ($tenant in $tenants) { Write-Host "Adding local service accounts for `[$($tenant.Name) $($tenant.Signature)`]" Add-LocalServiceAccountsToAlkamiDatabase -ConnectionString $tenant.ConnectionString -DatabaseName $tenant.Catalog } }