Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a problem with PowerShell script in Tasks Sheduler in Windows Server 2008 R2. I try to run Sheduler Tasks which run batch file which run PowerShell script to Backup Farm and while I choose "Run only when user is logged on" script is working well but when I choose "Run wherther user i slogged on or not" script doesn't work and in Event Viewer I see Event 3351 which say below that Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'

Where is problem? Mayby I should add other user to SharePoint Shell Access?

I use SharePoint Foundarion, SQL Server 2008 and Windows Server 2008 R2

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

Here is what you should do:

  • Run the task under designated service account e.g. CONTOSO\sp_powershell
  • The account needs to have proper privilages, it needs SharePoint Shell Access (check Add-SPShellAdmin for more details)
share|improve this answer
    
Thanks a lot for your advice :) I will inform about progess in my case. –  Andrzej Oct 22 '12 at 14:57
    
It doesn't work for me, I created service account for run PowerShell Backup script in Tasks Sheduler and add that account to SharePoint Shell Access and nothing is changed. Should I add this account to every database? I ask because I added only to Config database? –  Andrzej Oct 23 '12 at 7:59
    
If you are trying to backup your Content databases then yes, it should have. If you are still having problems try to run PowerShell Shell as a different user (CONTOSO\sp_powershell) and troubleshoot permissions. –  Toni Frankola Oct 23 '12 at 9:06
    
I found solution for my case, I select "Run whether user is logged on or not" , "Run with highest privileges", "Hidden" and I didn't select "do not store password. The tasks will only have access to local resources" but to do this first I had to change Registry key HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa disabledomaincreds from 1 to 0 because earlier I can't do this. I saw Error message 2147943712. Now my Task is working good while I'm logon and while I'm logout. –  Andrzej Oct 24 '12 at 11:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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