-2

i'm write powershell script for update userthumbnailPhoto. I'm use Get-ADObject and Set-ADObject for thistask.

When i run script under logged in user - script work fine and update AD user.

When i make scheduled task, and run script - script work, but Set-ADObject does not change anything. Task created to run with same user credentials when logged on or not. Also i trying set "run with hight privilegies"

Why it's may happen?

Actimele
  • 103
  • 1

1 Answers1

1

Debug it with try/catch like:

Try {
Set-Mailbox <...........> -ErrorAction stop
}
Catch {
$_ | Out-File c:\script.log -Append
}
Vadim
  • 596
  • 3
  • 10