Apr 03 2020 01:20 AM
Hello
I am running a Powershell to update a list.
While running this powershell with my user account the columns are updated.
While running this powershell through taks-scheduler (other user) the data within the columns are dropped but
not updated. The user from task-scheduler is owner of the specific list.
What could be the reason.
Thank you
J.
Apr 03 2020 08:06 PM
Apr 05 2020 11:26 PM
Hello
Thank you for your input.
I did already run try-catch and no errors
The task-Scheduler runs with an technical user with highest privileges.
The funny Thing user drops the data within the column but does not inserts the data.
Here the sample:
$items = $list.Items
foreach($item in $items)
{
$owner = $item['Besitzer']
$ownertest = $owner -replace ".*#"
$costcentercsv = $CSVData | Where-Object {$_.UsEMail -eq $ownertest} | % UsAccountNum
$item[$costcenter] = $costcentercsv
$item.Update();
}
}
Catch
{
$logger.LogError("Exception raised")
$logger.LogException($_.Exception)
$script:sitesErrors = $script:sitesErrors + 1
$script:scriptError = $true
}
Regards