Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Group Managed Service Account (gMSA) support #366

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,28 @@ svc.sudo.password = 'password';
...
```

**app.js**

To use Group Managed Service Accounts, append `$` to the end of account name and specify `svc.logOnAs.gmsa = true`


```js
var Service = require('node-windows').Service;

// Create a new service object
var svc = new Service({
name:'Hello World',
script: require('path').join(__dirname,'helloworld.js'),
allowServiceLogon: true
});

svc.logOnAs.domain = 'mydomain.local';
svc.logOnAs.account = 'username_$';
svc.logOnAs.gmsa = true;
...
```


### Depending on other services

The service can also be made dependant on other Windows services.
Expand Down
1 change: 1 addition & 0 deletions lib/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ var daemon = function (config) {
enumerable: false,
writable: true,
configurable: false,
gmsa: false,
value: {
account: null,
password: null,
Expand Down
5 changes: 4 additions & 1 deletion lib/winsw.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,12 @@ console.log({loc: 'winsw.js ~line 77', xml, config})
var serviceaccount = [
{ domain: config.logOnAs.domain || 'NT AUTHORITY' },
{ user: config.logOnAs.account || 'LocalSystem' },
{ password: config.logOnAs.password || '' }
]

if(!config.logOnAs.gmsa){
serviceaccount.push({ password: config.logOnAs.password || '' })
}

if (config.allowServiceLogon) {
serviceaccount.push({ allowservicelogon: 'true' })
}
Expand Down