none
How to create a Power Shell script to Manually Modify Timer Jobs?

    Dotaz

  • Hello,

    I want a recurring workflow that will send out a notification email every year, at the same time.  I have found the IMP Retention Policy options are the best way to do this to trigger a workflow and repeat it.  I want to be able to test these Retention Policies on a couple of my document libraries on a daily basis and experience immediate results for testing purposes.

    Unfortunately, I do not have the rights to the Central Admin to be able to manually adjust the two timer Jobs from default (weekly) to a run on a daily/hourly basis. I have contacted our IT Helpdesk but I am not sure I will be granted access.

    I have recieved the advice to use a Power Shell to adjust the Timer Jobs settings.  I am not very familair with Power Shells, so I am looking for somewhat detailed steps that describe what to do (ie. Scripts)?

    Thank you.

    Jerry Tokars

    14. června 2012 15:15

Odpovědi

  • You have to run the PowerShell commands from the SharePoint server.  Do you have access to one in the farm?

    Even if you do have access to one of the servers, your user (or the user you run the script as) must have elevated privileges in the farm (usually granted through the Add-SPShellAdmin PowerShell cmdlet).


    Bob Guidinger
    Please remember to click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if it was useful.

    14. června 2012 15:20
  • You're going to be limited to what you can achieve due to restrictions with your access. Bob is correct, to run any PowerShell scripts you will need access to the server itself unless remote has been configured.  Either way, for the requirements you have it sounds like you don't have enough permissions to carry out the necessary steps.  I would suggest either using a development environment if available or enlisting the help of someone who does have the relevant access and is willing to work alongside you.

    Your question about changing timerjobs and the effect on other sites will depend on what the timerjobs are.  What are the 2 timerjobs you're looking to change?


    Paul Turner http://redmanta.co.uk/blog Twitter: @RedMantaUK MCTS:WSS,MOSS,2010 MCITP:2010.
    Please remember to click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if it was useful.

    14. června 2012 16:10

Všechny reakce

  • You have to run the PowerShell commands from the SharePoint server.  Do you have access to one in the farm?

    Even if you do have access to one of the servers, your user (or the user you run the script as) must have elevated privileges in the farm (usually granted through the Add-SPShellAdmin PowerShell cmdlet).


    Bob Guidinger
    Please remember to click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if it was useful.

    14. června 2012 15:20
  • Bob,

    I do not believe I have access to a SP server.  I think I would have a better chance of getting access to a the central admin rather than the SP server. Are there any other options?

    And assuming I am able to make changes to the timer jobs in the central admin; Will the changes I make effect other site within our farm additional to mine?  We use sharepoint company wide and there are many seperate team sites, project sites, etc.

    Thank you.

    Jerry

    14. června 2012 16:00
  • You're going to be limited to what you can achieve due to restrictions with your access. Bob is correct, to run any PowerShell scripts you will need access to the server itself unless remote has been configured.  Either way, for the requirements you have it sounds like you don't have enough permissions to carry out the necessary steps.  I would suggest either using a development environment if available or enlisting the help of someone who does have the relevant access and is willing to work alongside you.

    Your question about changing timerjobs and the effect on other sites will depend on what the timerjobs are.  What are the 2 timerjobs you're looking to change?


    Paul Turner http://redmanta.co.uk/blog Twitter: @RedMantaUK MCTS:WSS,MOSS,2010 MCITP:2010.
    Please remember to click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if it was useful.

    14. června 2012 16:10
  • Paul,

    Thank you for your helpful feedback. It sounds like the PowerShell option may be a dead end for me.  If I am granted access to the Central Admin, then I can make the neccessary changes to the timer jobs there. 

    The two timer jobs I am planning on adjusting are the Information Management Policy AND the Expiration Policy. 

    Thank you.

    Jerry

    14. června 2012 16:41