{"id":22758648,"url":"https://github.com/michaelschoenburg/runtaskasuser","last_synced_at":"2026-05-04T03:31:23.410Z","repository":{"id":111207422,"uuid":"374906054","full_name":"MichaelSchoenburg/RunTaskAsUser","owner":"MichaelSchoenburg","description":"This Script runs a task in the context of another UserName.","archived":false,"fork":false,"pushed_at":"2021-06-08T19:01:53.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T08:29:15.272Z","etag":null,"topics":["powershell","powershell-script","task-scheduler","terminalserver","windows"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MichaelSchoenburg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-08T06:31:35.000Z","updated_at":"2024-11-01T02:11:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"4a3b9a64-25b0-4255-98dc-d8409612eb84","html_url":"https://github.com/MichaelSchoenburg/RunTaskAsUser","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/MichaelSchoenburg/RunTaskAsUser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelSchoenburg%2FRunTaskAsUser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelSchoenburg%2FRunTaskAsUser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelSchoenburg%2FRunTaskAsUser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelSchoenburg%2FRunTaskAsUser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MichaelSchoenburg","download_url":"https://codeload.github.com/MichaelSchoenburg/RunTaskAsUser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelSchoenburg%2FRunTaskAsUser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32593734,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"online","status_checked_at":"2026-05-04T02:00:06.625Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["powershell","powershell-script","task-scheduler","terminalserver","windows"],"created_at":"2024-12-11T08:15:09.247Z","updated_at":"2026-05-04T03:31:23.403Z","avatar_url":"https://github.com/MichaelSchoenburg.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"`Get-Help .\\RunTaskAsUser.ps1 -Full`\n\n```\nNAME\n    RunTaskAsUser.ps1\n    \nSYNOPSIS\n    This Script runs a task in the context of another UserName.\n    \n    \nSYNTAX\n    C:\\Users\\mschoenburg.CENTER\\Desktop\\RunTaskAsUser.ps1 [-UserName] \u003cString\u003e [-PathToFile] \u003cString\u003e [[-Arguments] \u003cString\u003e] [-Computer \u003cString\u003e] [\u003cCommonParameters\u003e]\n    \n    \nDESCRIPTION\n    This Script uses the task scheduler to create a new task in the context of specified UserName, runs it immediately after and deletes it in the end.\n    \n\nPARAMETERS\n    -UserName \u003cString\u003e\n        The UserName in whose context the File should be executed.\n        \n        Required?                    true\n        Position?                    1\n        Default value                \n        Accept pipeline input?       false\n        Accept wildcard characters?  false\n        \n    -PathToFile \u003cString\u003e\n        The File that is to be executed\n        \n        Required?                    true\n        Position?                    2\n        Default value                \n        Accept pipeline input?       false\n        Accept wildcard characters?  false\n        \n    -Arguments \u003cString\u003e\n        The Arguments that should be passed along to the File.\n        \n        Required?                    false\n        Position?                    3\n        Default value                \n        Accept pipeline input?       false\n        Accept wildcard characters?  false\n        \n    -Computer \u003cString\u003e\n        The computer/server this should happen on.\n        Defaults to localhost.\n        \n        Required?                    false\n        Position?                    named\n        Default value                ($env:computername)\n        Accept pipeline input?       false\n        Accept wildcard characters?  false\n        \n    \u003cCommonParameters\u003e\n        This cmdlet supports the common parameters: Verbose, Debug,\n        ErrorAction, ErrorVariable, WarningAction, WarningVariable,\n        OutBuffer, PipelineVariable, and OutVariable. For more information, see\n        about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216). \n    \nINPUTS\n    See parameters.\nOUTPUTS\n    None.\n    \n    \nNOTES\n    \n    \n        Author: Michael Schönburg\n        Current version: 0.1\n        Last change: 08.06.2021\n    \n    -------------------------- EXAMPLE 1 --------------------------\n    \n    PS C:\\\u003e\u0026 'C:\\TMP\\RunTaskAsUserName.ps1' -UserName 'mschoenburg' -PathToFile 'C:\\TMP\\screenshot.lnk' -Computer 'My-RDS-01'\n    This runs the link screenshot.lnk in the context of the UserName mschoenburg on the terminal server My-RDS-01.\n    \n    \n    \n    \n    \n    \n    -------------------------- EXAMPLE 2 --------------------------\n    \n    PS C:\\\u003e\u0026 'C:\\TMP\\RunTaskAsUserName.ps1' -UserName 'mschoenburg' -PathToFile 'C:\\TMP\\MyProgram.exe'\n    This would be executed on the local machine.\n    \n    \n    \n    \n    \n    \n    -------------------------- EXAMPLE 3 --------------------------\n    \n    PS C:\\\u003e\u0026 'C:\\TMP\\RunTaskAsUserName.ps1' -UserName 'mschoenburg' -PathToFile 'C:\\Program Files (x86)\\Microsoft Office\\root\\Office16\\OUTLOOK.EXE' -Arguments '/safe'\n    This would start outlook in safe mode.\n    \n    \n    \n    \n    \n    \n    \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelschoenburg%2Fruntaskasuser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelschoenburg%2Fruntaskasuser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelschoenburg%2Fruntaskasuser/lists"}