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 =
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
$cmdparam =
c:\scripts\script00113.ps1
$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