-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?

1

Debug it with try/catch like:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.