Fixed naming and added task scheduling script

This commit is contained in:
tremor021 2021-04-14 15:23:22 +02:00
parent cdc7da86f3
commit 34667f252e
4 changed files with 8 additions and 2 deletions

View File

@ -473,7 +473,7 @@
},
{
"guid": "57997ec7-b293-4fd5-9f90-a25426d0eb90",
"filename": "Get_Computer_Users.ps1",
"filename": "Win_Get_Computer_Users.ps1",
"submittedBy": "https://github.com/tremor021",
"name": "Get Computer Users",
"description": "Get list of computer users and show which one is enabled",
@ -482,7 +482,7 @@
},
{
"guid": "77da9c87-5a7a-4ba1-bdde-3eeb3b01d62d",
"filename": "Set_Network_To_Private.ps1",
"filename": "Win_Set_Network_To_Private.ps1",
"submittedBy": "https://github.com/tremor021",
"name": "Set Network To Private",
"description": "Sets current network type to Private",

View File

@ -0,0 +1,6 @@
# Add a task to Task Scheduler
$Trigger = New-ScheduledTaskTrigger -At 10:00am Daily # Specify the trigger settings
$User = "NT AUTHORITY\SYSTEM" # Specify the account to run the script
$Action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "YOUR COMMAND HERE" # Specify what program to run and with its parameters
Register-ScheduledTask -TaskName "SomeTaskName" -Trigger $Trigger -User $User -Action $Action -RunLevel Highest Force # Specify the name of the task