I have a file screen configured with a notification to write an event to the event log. I also want to configure that same file screen, using power shell, to run a power shell script. Does anyone know how I can add an action to a file screen template or a file screen??

I used the following to create my event notification action.

$EventNotification = New-FsrmAction Event -EventType Warning -Body $EventMessage

Then the following to add it to my File screen template:

New-FsrmFileScreenTemplate -Name $fileTemplateName -IncludeGroup Group1,Group2 -Active: $true -Notification $EventNotification

But when I create an action to run my power shell script I cannot figure out how to add it to the template, or just a file screen.

This is what I am using currently, how do i apply it to a template or file screen?

$CommandAction = new-fsrmAction -Type Command -Command $PowerShellPath -CommandParameters $cmdparam 

Additional info:

$PowerShellPath =

$cmdparam =
  • I may have found my answer: edugeek.net/forums/how-do-you-do/… $command = New-FsrmAction Command -Command "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"-CommandParameters "-ExecutionPolicy Bypass -command &{C:\Disconnect-SMBShares.ps1 -username '[Source Io Owner]'}" -SecurityLevel LocalSystem -KillTimeOut 5 -RunLimitInterval 0 – veel84 Jul 5 '17 at 15:44
  • If this worked for you please update the question with the answer below. You are free to answer your own questions! – Persistent13 Jul 28 '17 at 20:28

I found my answer at this link http://www.edugeek.net/forums/how-do-you-do/159149-cryptolocker-prevention-3.html

$command = New-FsrmAction Command -Command "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"-‌​CommandParameters "-ExecutionPolicy Bypass -command &{C:\Disconnect-SMBShares.ps1 -username '[Source Io Owner]'}" -SecurityLevel LocalSystem -KillTimeOut 5 -RunLimitInterval 0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.