With powershell:
$TaskPath = "\"
$TaskName = "test"
$Action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "D:\123.ps1"
$Trigger = New-ScheduledTaskTrigger -AtLogOn
$ScheduledTask = New-ScheduledTask -Action $action -Trigger $trigger
Register-ScheduledTask -TaskName "$TaskPath$TaskName" -InputObject $ScheduledTask
$triggersession = " <Triggers>
<SessionStateChangeTrigger>
<Enabled>true</Enabled>
<StateChange>RemoteConnect</StateChange>
</SessionStateChangeTrigger>
<SessionStateChangeTrigger>
<Enabled>true</Enabled>
<StateChange>ConsoleConnect</StateChange>
</SessionStateChangeTrigger>"
$taskoutput = Export-ScheduledTask -TaskName $TaskName -TaskPath $TaskPath
$taskoutput = $taskoutput -replace " <Triggers>", $triggersession
Register-ScheduledTask -Xml $taskoutput -TaskName "$TaskPath$TaskName" -force
Friday, September 22, 2023
Add "on connection to user session" for task scheduler
Monday, September 11, 2023
Friday, March 03, 2023
Browse https failed
The thing happen like this, i found out my browser cant not work for all https website (which previous day still can browse)
Here is the action i do:
1) Try different browser (chrome, firefox, IE, edge(new), opera(new)), even use powershell to invoke it.
* after some day, i install comodo browser, and it is work.
2) Restart windows
3) Reset firefox setting/profile. reinstall chrome/firefox.
4) Dism restorehealth, sfc
5) Windows update
6) Change local ip, reset network winsock
7) Change timezone, change different time
8) On/Off firewall.
9) Use some tool to monitor (Procmon64,procexp64 and so on)
10) Also use wireshark/openssl (it show TLS have some problem, but i not too sure how to fix it)
** there is few time after the setting change (not too remember what the action - windows update/reset network winsock), the https is work, but after a second, it failed again.
Below is error show on browser:
Chrome: This site can’t be reached, www.yahoo.com unexpectedly closed the connection.
Firefox: Secure Connection Failed, Error code: PR_END_OF_FILE_ERROR.
After few day of checking, i try to rejoin domain. After this, everything is work as normal. DAMM
Any expert can tell me what goes wrong?