none
Looking for a variable to set the "Write to the windows application event log" event level to 0 on SQL Agent jobs

    Question

  • Does anyone have this command?  I have the rest of the script waiting to go, I just can't seem to find this one item. =(

    In the organization I am working with, they have never had a standard for their SQL Agent jobs, or for SQL Instances all together.  They are implementing SCOM 2012 and have almost a thousand instances (high 800's).  Each over the servers has multiple jobs on it.

    I have a script that pulls the server names from a database.

    That script then needs to find the job properties and check it "write to the Windows Application event log" is set to 0.  I ONLY need that line.  I know it will be a get-SQLJob or something like that, but I can't find anything anywhere for it.

    Anyone?


    • Edited by vyndel Wednesday, February 06, 2013 3:34 PM
    Wednesday, February 06, 2013 3:00 PM

Answers

  • Doesn't Powershell fall under general windows scripting?

    Yes, but it sounds like you're not asking about about PowerShell but rather something specific about SQL Server. A better forum for your question might be SQL Server Manageability.

    Bill

    • Marked as answer by vyndel Wednesday, February 06, 2013 4:42 PM
    Wednesday, February 06, 2013 4:07 PM
    Moderator
  • Thanks, I'll move it over there.
    • Marked as answer by vyndel Wednesday, February 06, 2013 4:42 PM
    Wednesday, February 06, 2013 4:08 PM

All replies

  • A variable? A variable is a memory storage location for data. Your question doesn't make sense to me.

    Bill

    Wednesday, February 06, 2013 3:32 PM
    Moderator
  • Thanks, yeah, not a variable, the "get-" command.  Sorry, been working on a few items at once and the frustration on this one command is making me a bit loopy.
    Wednesday, February 06, 2013 3:34 PM
  • I still don't understand what you want to do.

    Bill

    Wednesday, February 06, 2013 3:38 PM
    Moderator
  • In SQL there are agent jobs that run different commands, clean ups, etc.  For SCOM to monitor if these jobs fail, and to alert if they do, those jobs need to have a specific property in them "Write to the Windows Application Event Log" and it needs to be set to "when the job fails".

    I need the "get" command that will tell me the property of that in a job.  I have been searching for it for 2 days, and am unable to find if it even exists.

    Wednesday, February 06, 2013 3:46 PM
  • You probably need to ask your question in a SQL forum. This is a general Windows scripting forum.

    Bill

    Wednesday, February 06, 2013 3:49 PM
    Moderator
  • Doesn't Powershell fall under general windows scripting?  I am more than happy to move my question to a new forum, I just want to make sure that if it is moved, it is to the correct place.

    Wednesday, February 06, 2013 3:56 PM
  • Doesn't Powershell fall under general windows scripting?

    Yes, but it sounds like you're not asking about about PowerShell but rather something specific about SQL Server. A better forum for your question might be SQL Server Manageability.

    Bill

    • Marked as answer by vyndel Wednesday, February 06, 2013 4:42 PM
    Wednesday, February 06, 2013 4:07 PM
    Moderator
  • Thanks, I'll move it over there.
    • Marked as answer by vyndel Wednesday, February 06, 2013 4:42 PM
    Wednesday, February 06, 2013 4:08 PM