Merge pull request #394 from tremor021/develop

Fixed script naming scheme
This commit is contained in:
Dan
2021-04-14 18:20:31 -07:00
committed by GitHub
4 changed files with 17 additions and 2 deletions

View File

@@ -554,7 +554,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",
@@ -563,11 +563,20 @@
},
{
"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",
"shell": "powershell",
"category": "TRMM (Win):Network"
},
{
"guid": "768f42d5-7b45-45ed-8233-254ae537aaa2",
"filename": "Win_TaskScheduler_Add_Task.ps1",
"submittedBy": "https://github.com/tremor021",
"name": "Add task to TaskScheduler",
"description": "Add a task to Task Scheduler, needs editing",
"shell": "powershell",
"category": "TRMM (Win):Other"
}
]

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