New Friend (or an Old Friend who Built a New Account)
Registered: 1451984981 Posts: 19
Reply with quote #1
I am trying to add multiple notifications onto an FSRM file screen that I'm creating using Powershell. This is the shortened version of the code: $notification_event = New-FSRMAction Event -EventType Error -Body "Event log message" -RunLimitInterval 30 New-FSRMFileScreen -Path "$rootpath" -Active:$True -includeGroup MyFileGroup -Notification $notification -Confirm:$false According to the help for New-FSRMFileScreen (https://technet.microsoft.com/en-us/library/jj900623(v=wps.630).aspx) I can pass an array of notification objects to the -Notification parameter. What I'm trying to achieve is FSRM writing an event log AND running a command (script) when it blocks a file. So far, I've tried this: $notification_event = New-FSRMAction Event -EventType Error -Body "Event log message" -RunLimitInterval 30 $notification_command = New-FSRMAction Command -Command "C:\MyCommand.bat" $notification_array = @($notification_event,$notification_command) I then pass $notification_Array to the cmdlet instead. But it just won't have it. I'm stuck - Can anyone shed some light on where I'm going wrong........ please?!!
Registered: 1451592353 Posts: 243
Reply with quote #2
according to the help, you are supposed to generate action items using New-FsrmFmjNotificationAction (https://technet.microsoft.com/de-de/library/jj900634(v=wps.630).aspx) and not New-FsrmAction. __________________ Evgenij Smirnov My personal blog (German): http://www.it-pro-berlin.de/ My stuff on PSGallery: https://www.powershellgallery.com/profiles/it-pro-berlin.de/
Hacked Mark's Facebook Account
Registered: 1451567414 Posts: 273
Reply with quote #3
Did Help drop the ball on this one?
Folks writing PoSh cmdlets need to offer useful examples for non-obvious but useful features. __________________ May I ask that everyone please populate the first name and last name in your user account profile. Thanks!