mirror of
https://github.com/jprdonnelly/qseow-scripts.git
synced 2026-05-16 06:00:01 -04:00
Working - PDAR bug
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
BIN
testdata.xlsx
BIN
testdata.xlsx
Binary file not shown.
Reference in New Issue
Block a user