Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mkht/dscr_logonscript
DSC Resource for set Logon / Logoff / Startup / Shutdown script in local group policy
https://github.com/mkht/dscr_logonscript
Last synced: about 1 month ago
JSON representation
DSC Resource for set Logon / Logoff / Startup / Shutdown script in local group policy
- Host: GitHub
- URL: https://github.com/mkht/dscr_logonscript
- Owner: mkht
- License: mit
- Created: 2018-09-30T06:04:10.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-20T10:48:50.000Z (over 5 years ago)
- Last Synced: 2024-10-29T05:38:26.191Z (about 2 months ago)
- Language: PowerShell
- Size: 15.6 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
DSCR_LogonScript
====DSC Resource for set Logon / Logoff / Startup / Shutdown script in the local group policy
----
## Installation
You can install this module from [PowerShell Gallery](https://www.powershellgallery.com/packages/DSCR_LogonScript/).
```Powershell
Install-Module -Name DSCR_LogonScript
```## Dependencies
* [DSCR_FileContent](https://github.com/mkht/DSCR_FileContent)----
## **LogonScript**
Set Logon / Logoff / Startup / Shutdown script in the local group policy### Properties
+ [string] **ScriptPath** (Require):
+ The path of the script.+ [string] **Parameters** (Optional):
+ The parameter of the script.+ [string] **ScriptType** (Optional):
+ Specify the script type is `Command` or `PowerShell` (The default is `Command`)+ [string] **RunAt** (Optional):
+ Specify when the script should be execute.
+ The default is `Logon`. (`Logon` / `Logoff` / `Startup` / `Shutdown`)+ [int] **Index** (Optional):
+ The order of the script should be execute.
+ The default is `0`. (`0 - 99`)### Examples
+ **Example 1**: Set logon scripts
```Powershell
Configuration Example1
{
Import-DscResource -ModuleName DSCR_LogonScript
LogonScript logon1
{
RunAt = 'Logon'
ScriptPath = 'C:\first.bat'
Index = 0
}
LogonScript logon2
{
RunAt = 'Logon'
ScriptPath = 'C:\second.bat'
Parameters = 'param x'
Index = 1
}
}
```+ **Example 2**: Set a logon PowerShell script
```Powershell
Configuration Example2
{
Import-DscResource -ModuleName DSCR_LogonScript
LogonScript logonPS1
{
RunAt = 'Logon'
ScriptPath = 'C:\PSFirst.ps1'
ScriptType = 'PowerShell'
Index = 0
}
}
```+ **Example 3**: Set logon / logoff / startup / shutdown scripts
```Powershell
Configuration Example3
{
Import-DscResource -ModuleName DSCR_LogonScript
LogonScript logon
{
RunAt = 'Logon'
ScriptPath = 'C:\logon.bat'
}
LogonScript logoff
{
RunAt = 'Logoff'
ScriptPath = 'C:\logoff.bat'
}
LogonScript startup
{
RunAt = 'Startup'
ScriptPath = 'C:\startup.bat'
}
LogonScript shutdown
{
RunAt = 'Shutdown'
ScriptPath = 'C:\shutdown.bat'
}
}
```----
## ChangeLog
### 0.9.1
+ Add a new property `ScriptType`
+ **[BREAKING]** Change the param name from `Type` to `RunAt`
+ Change the dependencies module from [DSCR_IniFile](https://github.com/mkht/DSCR_IniFile) to [DSCR_FileContent](https://github.com/mkht/DSCR_FileContent)
+ Improve stabilities.
+ miscellaneous fixes.### 0.0.2
+ Initial public release