Configure WINRM on remote machine and use this template to monitor last task status using PowerShell Script
You can use below commands in PowerShell to configure WinRM on remote machine before using this Template.
winrm quickconfig
enable-PSRemoting -Force
winrm s winrm/config/client '@{TrustedHosts="*"}' ( You can put a hostname or IP to restrict server from where remote connection is allowed.