Script Name: ScreenShot Script Description: IF Test File Parameter 1 : #vAgentConfiguration.AgentTempDir#\cmdcapturewin.exe Exists : THEN Execute Shell Command Parameter 1 : echo %random%>>#vAgentConfiguration.AgentTempDir#\datetime.txt Parameter 2 : 1 OS Type : 13 Get Variable Parameter 1 : 1 Parameter 2 : #vAgentConfiguration.AgentTempDir#\datetime.txt Parameter 3 : datetime OS Type : 13 Execute Shell Command Parameter 1 : #vAgentConfiguration.AgentTempDir#\cmdcapturewin.exe /f "#vAgentConfiguration.AgentTempDir#\desktop-#datetime#.jpg" /q 50 Parameter 2 : 1 OS Type : 13 Get File Parameter 1 : #vAgentConfiguration.AgentTempDir#\desktop-#datetime#.jpg Parameter 2 : ..\Docs\#vAgentConfiguration.Machname#-desktop-#datetime#.jpg Parameter 3 : 1 OS Type : 13 Delete File Parameter 1 : #vAgentConfiguration.AgentTempDir#\datetime.txt OS Type : 13 Delete File Parameter 1 : #vAgentConfiguration.AgentTempDir#\desktop-#datetime#.jpg OS Type : 13 Delete File Parameter 1 : #vAgentConfiguration.AgentTempDir#\cmdcapturewin.exe OS Type : 13 ELSE Get URL Parameter 1 : http://files.kaseya.com/sftp/CmdCaptureWin.exe Parameter 2 : #vAgentConfiguration.AgentTempDir#\cmdcapturewin.exe Parameter 3 : 3 OS Type : 13 Schedule Script Parameter 1 : 83199753 Parameter 2 : 1 Parameter 3 : OS Type : 13
Benjamin.Lavalley@kaseya.comTry switching up the procedure to run the cmdcapturewin.exe process as user instead of system?
cameronprattoI also would like to know how I can modify the script (or schedule a follow-up script) to delete the screenshots from the user's drive (temp folder) after they've been dumped to the KServer. Thanks.
thirteentwentyI almost reposted the script... But if you re-read it, that's exactly what this one does...
Benjamin.Lavalley@kaseya.comI even used to have it write the timestamp to the datetime variable but ran into issues with how the datetime was being created in the command line. One of my other stolen laptop scripts might leave files on the drive, I'd have to go look at them all to find out for sure.
Script Name: XP ScreenShot Script Description: IF True THEN Get URL Parameter 1 : http://files.kaseya.com/sftp/CmdCaptureWin.exe Parameter 2 : #vAgentConfiguration.AgentTempDir#\cmdcapturewin.exe Parameter 3 : 3 OS Type : 13 Execute Shell Command Parameter 1 : echo %random%>>#vAgentConfiguration.AgentTempDir#\datetime.txt Parameter 2 : 1 OS Type : 13 Get Variable Parameter 1 : 1 Parameter 2 : #vAgentConfiguration.AgentTempDir#\datetime.txt Parameter 3 : datetime OS Type : 13 Execute Shell Command Parameter 1 : #vAgentConfiguration.AgentTempDir#\cmdcapturewin.exe /f "#vAgentConfiguration.AgentTempDir#\desktop-#datetime#.jpg" /q 50 Parameter 2 : 1 OS Type : 13 Get File Parameter 1 : #vAgentConfiguration.AgentTempDir#\desktop-#datetime#.jpg Parameter 2 : ..\Docs\#vAgentConfiguration.Machname#-desktop-#datetime#.jpg Parameter 3 : 1 OS Type : 13 Delete File Parameter 1 : #vAgentConfiguration.AgentTempDir#\datetime.txt OS Type : 13 Delete File Parameter 1 : #vAgentConfiguration.AgentTempDir#\desktop-#datetime#.jpg OS Type : 13 Delete File Parameter 1 : #vAgentConfiguration.AgentTempDir#\cmdcapturewin.exe OS Type : 13 ELSE Get URL Parameter 1 : http://files.kaseya.com/sftp/CmdCaptureWin.exe Parameter 2 : #vAgentConfiguration.AgentTempDir#\cmdcapturewin.exe Parameter 3 : 3 OS Type : 13 Schedule Script Parameter 1 : 83199753 Parameter 2 : 1 Parameter 3 : OS Type : 13
thirteentwentyI've been thinking about doing that too, as far as putting the timestamp in the file name but am having issues with piping out the data also. I'll be sure to post if I figure it out... or when I figure it out... modifying/improving scripts are kind of on the back burner for a bit...
echo %date:~-4,4%%date:~-10,2%%date:~-7,2% >> #vAgentConfiguration.agentTempDir#\Date.txt
ReedMikelWouldn't most of us want the local machine's time? I know I would. Unless you have clients all over the world, which is a good problem
ReedMikelI must not be understanding your initial comment Andrew. My point was that since the vast majority of us only have clients that reside in the same time zone as us (the client's MSP), then there's really no concern about different date formats. Now, Kaseya on the other hand, does have clients all over the world - so date formats would be an issue for them...
echo %date:~-4,4%%date:~-7,2%%date:~-10,2% >> #vAgentConfiguration.agentTempDir#\Date.txt