{"id":19954029,"url":"https://github.com/mkht/dscr_logonscript","last_synced_at":"2026-05-09T22:03:00.063Z","repository":{"id":57668232,"uuid":"150935994","full_name":"mkht/DSCR_LogonScript","owner":"mkht","description":"DSC Resource for set Logon / Logoff / Startup / Shutdown script in local group policy","archived":false,"fork":false,"pushed_at":"2019-04-20T10:48:50.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T18:49:40.999Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkht.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-30T06:04:10.000Z","updated_at":"2024-02-24T22:35:54.000Z","dependencies_parsed_at":"2022-09-07T15:50:42.109Z","dependency_job_id":null,"html_url":"https://github.com/mkht/DSCR_LogonScript","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkht%2FDSCR_LogonScript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkht%2FDSCR_LogonScript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkht%2FDSCR_LogonScript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkht%2FDSCR_LogonScript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkht","download_url":"https://codeload.github.com/mkht/DSCR_LogonScript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241382611,"owners_count":19953969,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-13T01:18:38.335Z","updated_at":"2026-05-09T22:02:59.962Z","avatar_url":"https://github.com/mkht.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"DSCR_LogonScript\n====\n\nDSC Resource for set Logon / Logoff / Startup / Shutdown script in the local group policy\n\n----\n## Installation\nYou can install this module from [PowerShell Gallery](https://www.powershellgallery.com/packages/DSCR_LogonScript/).\n```Powershell\nInstall-Module -Name DSCR_LogonScript\n```\n\n## Dependencies\n* [DSCR_FileContent](https://github.com/mkht/DSCR_FileContent)\n\n----\n## **LogonScript**\nSet Logon / Logoff / Startup / Shutdown script in the local group policy\n\n### Properties\n+ [string] **ScriptPath** (Require):\n    + The path of the script.\n\n+ [string] **Parameters** (Optional):\n    + The parameter of the script.\n\n+ [string] **ScriptType** (Optional):\n    + Specify the script type is `Command` or `PowerShell` (The default is `Command`)\n\n+ [string] **RunAt** (Optional):\n    + Specify when the script should be execute.\n    + The default is `Logon`. (`Logon` / `Logoff` / `Startup` / `Shutdown`)\n\n+ [int] **Index** (Optional):\n    + The order of the script should be execute.\n    + The default is `0`. (`0 - 99`)\n\n\n### Examples\n+ **Example 1**: Set logon scripts\n```Powershell\nConfiguration Example1\n{\n    Import-DscResource -ModuleName DSCR_LogonScript\n    LogonScript logon1\n    {\n        RunAt = 'Logon'\n        ScriptPath = 'C:\\first.bat'\n        Index = 0\n    }\n    \n    LogonScript logon2\n    {\n        RunAt = 'Logon'\n        ScriptPath = 'C:\\second.bat'\n        Parameters = 'param x'\n        Index = 1\n    }\n}\n```\n\n+ **Example 2**: Set a logon PowerShell script\n```Powershell\nConfiguration Example2\n{\n    Import-DscResource -ModuleName DSCR_LogonScript\n    LogonScript logonPS1\n    {\n        RunAt = 'Logon'\n        ScriptPath = 'C:\\PSFirst.ps1'\n        ScriptType = 'PowerShell'\n        Index = 0\n    }\n}\n```\n\n+ **Example 3**: Set logon / logoff / startup / shutdown scripts\n```Powershell\nConfiguration Example3\n{\n    Import-DscResource -ModuleName DSCR_LogonScript\n    LogonScript logon\n    {\n        RunAt = 'Logon'\n        ScriptPath = 'C:\\logon.bat'\n    }\n    \n    LogonScript logoff\n    {\n        RunAt = 'Logoff'\n        ScriptPath = 'C:\\logoff.bat'\n    }\n    \n    LogonScript startup\n    {\n        RunAt = 'Startup'\n        ScriptPath = 'C:\\startup.bat'\n    }\n    \n    LogonScript shutdown\n    {\n        RunAt = 'Shutdown'\n        ScriptPath = 'C:\\shutdown.bat'\n    }\n}\n```\n\n----\n## ChangeLog\n### 0.9.1\n + Add a new property `ScriptType`\n + **[BREAKING]** Change the param name from `Type` to `RunAt`\n + Change the dependencies module from [DSCR_IniFile](https://github.com/mkht/DSCR_IniFile) to [DSCR_FileContent](https://github.com/mkht/DSCR_FileContent)\n + Improve stabilities.\n + miscellaneous fixes.\n\n### 0.0.2\n + Initial public release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkht%2Fdscr_logonscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkht%2Fdscr_logonscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkht%2Fdscr_logonscript/lists"}