locked
Unable to execute script from task scheduler RRS feed

  • Question

  • I am unable to execute powershell script from task scheduler. My sharepoint 2010 application is setup on Windows Server 2012. 

    I am getting below error

    PS>TerminatingError(Get-SPSite): "Microsoft SharePoint is not supported with version 4.0.30319.34014 of the Microsoft .Net Runtime."
    Get-SPSite : Microsoft SharePoint is not supported with version 4.0.30319.34014 of the Microsoft .Net Runtime.

    Can anyone help me on this

    Tuesday, March 5, 2019 2:17 PM

All replies

  • HI Iftikar,

    First try to execute that script locally and if you got the same error then You can the below article.

    https://blogs.technet.microsoft.com/mspfe/2012/09/05/sharepoint-2010-management-shell-net-4-0-runtime-version-error/

    _______________________ 

    Thivagar SEGAR
    [If this Post helps you, then please don't forget to mark it answer or Vote for this post]

    Tuesday, March 5, 2019 2:26 PM
  • Hi Iftikar,

    If THIVAGAR's reply helps you, please remember to mark it as an answer, it will be beneficial to others in the community who meet this similar issue in the future. 

    Best Regards, 

    Lisa Chen


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Wednesday, March 6, 2019 2:49 AM
  • I am able to execute the script locally. I have already gone through that article. My issue is only with scheduler.
    Wednesday, March 6, 2019 5:34 AM
  • Hi Iftikar,

    Then check that user account has permission in "Log on as a batch job" in Group policy 

    Open Run in the server and type gpedit.msc and navigate the folder as mentioned in below image. once added the user ID then check the job in scheduler

    Or provide local administrator privilege to that user ID and test it 

     

    _______________________ 

    Thivagar SEGAR
    [If this Post helps you, then please don't forget to mark it answer or Vote for this post]


    Wednesday, March 6, 2019 1:25 PM
  • Hi Iftikar,

    If THIVAGAR's reply helps you, please remember to mark it as an answer

    Thanks for your understanding. 

    Best Regards, 

    Lisa Chen


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Monday, March 11, 2019 8:19 AM
  • Hi Iftikar,

    Is there anything update? 

    If THIVAGAR's reply helps you, please remember to mark it as an answer.

    Thanks for your understanding. 

    Best Regards, 

    Lisa Chen


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Tuesday, March 19, 2019 8:14 AM