Author Posts

November 10, 2017 at 7:19 pm

i'm specifically using scom cmdlets, but maybe this isn't a scom-specific question.

"get-scomrecovery | get-member" returns a property named "writeaction""

WriteAction Property Microsoft.EnterpriseManagement.Configuration.ManagementPackWriteActionModule WriteAction {get;set;}

i'm curious about how I might use that {get;set} at the end.

$recovery.writeaction.configuration is an XML string that I need to edit in bulk for a lot of $recoveries. I know how to get that string and edit it to what I want, but i'm hoping "set" will let me update that property to the new string and update the Recovery object in scom with that new string.

November 10, 2017 at 11:47 pm

In most cases ...

get = read only
set = writable, you can overwrite the content / value sored in the property.

If you mean change the property name, not it content/value, then that is a custom property thing.

As per the help files...

ManagementPackRecovery.WriteAction Property

Gets or sets a write action module definition that is executed. If a condition detection is specified, then the write action will only be executed if the data passes through the condition detection module.
'msdn.microsoft.com/en-us/library/microsoft.enterprisemanagement.configuration.managementpackrecovery.writeaction.aspx?f=255&MSPPError=-2147217396'

November 10, 2017 at 11:52 pm

I want to change the value of

$recovery.writeaction.configuration

that msdn article doesn't say anything about powershell syntax.

I tried

$recovery.writeaction.configuration = $mynewstring

but that doesn't seem to be writing the $mynewstring value back into scom.

November 27, 2017 at 5:28 pm

what would be the syntax to change the value of $recovery.writeaction.configuration

November 28, 2017 at 7:36 pm

The get;set seems to be C# specific per the link above.

Here is a list of all the SCOM cmdlet's, I'd look through the list of set's and see if anything looks to be helpful

Where are you getting "$recovery.writeaction.configuration" from?