SCOM Rule Run As Account

Forum: Operations Manager4
Viewing 3 posts - 1 through 3 (of 3 total)
  • #226859
    Profile photo of Eric
    Eric
    Participant

    How do you add a run as account for a performance collection script or basically a rule? I know how to do it for a script monitor by editing the xml management pack. However, when i follow the same for a rule and try to import the mp I get the error “XSD verification failed for the management pack. The ‘RunAs’ attribute is not declared.”

    I created the rule through the console then exported the mp to edit it.

    #229210
    Profile photo of Anthony Milic
    Anthony Milic
    Participant

    Hi Eric,

    I’m posting this as it might help someone else. Below is a rule I made to backup our MPs using PShell (script omitted for brevity). You need to put the RunAs attribute in the “WriteAction” tag – in bold below.
    <Rule ID=”Sample.Rule.Timed.PShell.Script.LogEvent” Enabled=”true” Target=”SystemCenter!Microsoft.SystemCenter.RootManagementServer” ConfirmDelivery=”false” Remotable=”true” Priority=”Normal” DiscardLevel=”100″>
    <Category>Maintenance</Category>
    <DataSources>
    <DataSource ID=”Scheduler” TypeID=”System!System.Scheduler”>
    <Scheduler>
    <SimpleReccuringSchedule>
    <Interval Unit=”Minutes”>5</Interval>
    </SimpleReccuringSchedule>
    <ExcludeDates />
    </Scheduler>
    </DataSource>
    </DataSources>
    <WriteActions>
    <WriteAction ID=”ExecuteScript” RunAs=”Sample.RunAsProfile.LogEvent” TypeID=”Windows!Microsoft.Windows.PowerShellPropertyBagWriteAction”>
    <ScriptName>LogEvent.ps1</ScriptName>
    <ScriptBody>PShell code here</ScriptBody>
    <TimeoutSeconds>60</TimeoutSeconds>
    </WriteAction>
    </WriteActions>
    </Rule>

    Anthony

    #230298
    Profile photo of Leon Goodenough
    Leon Goodenough
    Participant

    Tried this and initially the MP would not import when I used the actual name of the runas account. Error indicated that it could not find the referenced account. I found  ‘secure references’ and used that ID as the runas profile. I was able to re-import the MP okay, but when the rule was scheduled to run, it no longer ran.

    <WriteActions>
    <WriteAction ID=”ExecuteCommand” RunAs=”RunAsProfile_320c221174d34933b6d6a29580c2868e” TypeID=”System!System.CommandExecuter”>
    <ApplicationName>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe</ApplicationName>

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.