Working - PDAR bug

This commit is contained in:
Justin Donnelly
2020-06-30 01:28:18 -04:00
parent 8b06438ac4
commit e9e440e27b
2 changed files with 3 additions and 4 deletions

View File

@@ -33,11 +33,12 @@ if (Test-Path $newCmdFile) {
Get-ChildItem -Path cert:\CurrentUser\My | Where-Object {$_.subject -eq 'CN=QlikClient'} |
Connect-Qlik -computername https://"$CentralNode":4242 -Username $QlikID | Out-Null
# Set $UserArray to a sorted, unique set of UserName from XLSX
# Set $UserArray to a sorted, unique set of UserName from XLSX. Convert all to UPPERCASE
foreach ($row in $xlsx) {
$UserArray += $row.UserName
}
$UserArray = $($UserArray | Sort-Object -Unique)
$UserArray = $UserArray.ToUpper()
# ForEach unique UserName in the xlsx, lookup the corresponding QSEoW UserID Number.
# If the UserName is in the User table for QSEoW, perform an Update-QlikUser with xlsx props.
@@ -54,13 +55,10 @@ foreach ($userID in $UserArray) {
$userIDNum = ($(Get-QlikUser -filter "userid eq '$userID'") |
Where-Object {$_.userDirectory -eq 'BROWNTOWN'} ).id
if ( $userIDNum ) {
# $newCMD = @()
# Lookup the current Custom Properties for each UserName from the spreadshseet.
$currCPvals = $((Get-QlikUser -id "$userIDNum").customProperties)
# $currCPvals = $(Get-QlikUser -filter "userid eq '$userID'" -full ).customProperties
foreach ($currVal in $currCPvals) {
$curr = $currVal.definition.name + "=" + $currVal.value
@@ -101,5 +99,6 @@ foreach ($userID in $UserArray) {
# Build the new list of commands that will update our users that exist in both the XLSX and QSEoW.
$newCMD = ("Update-QlikUser -id $userIDNum -customProperties " + '@(' + $newProps + ')' )
$newCMD | Out-File -Append $newCmdFile
Invoke-Expression $newCMD | Out-File -Append $outputLog
}
}

Binary file not shown.