我有一个configuration了通知的事件日志中写入事件的文件屏幕。 我也想configuration相同的文件屏幕,使用电源shell,运行电源shell脚本。 有谁知道我可以如何将一个行动添加到文件屏幕模板或文件屏幕?
我使用以下来创build我的事件通知操作。
$EventNotification = New-FsrmAction Event -EventType Warning -Body $EventMessage
然后将其添加到我的文件屏幕模板:
New-FsrmFileScreenTemplate -Name $fileTemplateName -IncludeGroup Group1,Group2 -Active: $true -Notification $EventNotification
但是,当我创build一个动作来运行我的电源shell脚本,我不知道如何将其添加到模板,或只是一个文件屏幕。
这是我目前使用的,我如何将它应用到模板或文件屏幕?
$CommandAction = new-fsrmAction -Type Command -Command $PowerShellPath -CommandParameters $cmdparam
附加信息:
$PowerShellPath = C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe $cmdparam = c:\scripts\script00113.ps1
我在这个链接find了我的答案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