Powershell FSRM command action not working
this 2 issue subject
i trying create fsrm screen command action it's not firing , no events logged except event log event have in screen. @ point i'm not sure how troubleshoot this.
in attempt troubleshoot , because need ot able create screen via powershell decided use example powershell action , add screen erroring out
the example
new-fsrmaction command -command "c:\windows\system32\cmd.exe"-commandparameters "echo [source file path] >> c:\log.txt" -shouldlogerror
this works, create screen doing following fails
new-fsrmfilescreen -path "$drive" -active: $false -includegroup "blarg1" -notification $notification
new-fsrmfilescreen : 0x80070057, parameter incorrect , gives below error
@ line:1 char:5
+ new-fsrmfilescreen -path "$drive" -active: $false -includegroup "blarg1" -no ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ categoryinfo : invalidargument: (msft_fsrmfilescreen:root/microsoft/..._fsrmfilescreen) [new-fsrmfilescreen], cimexception
if replace new-fsrmaction line
$notification = new-fsrmaction -type event -eventtype warning -body "user [source io owner] attempted save [source file path] [file screen path] on [server] server."
this works suspect command line off somehow though grabbed , technet.
hopefully can point out mistake
i able figure out creating filescreen gui running following command expand properties of action
get-fsrmfilescreen | select -expandproperty notification
i created fsrmaction how looked , worked! started taking variables off of new-fsrmaction figure out 1 offender , found out must include securitylevel , killtimeout though technet , provided example otherwise.
the working command is
new-fsrmaction command -command "c:\windows\system32\cmd.exe" -commandparameters "echo [source file path] >> c:\log.txt" -shouldlogerror -securitylevel localservice -killtimeout 0
Windows Server > Windows PowerShell
Comments
Post a Comment