# Security_SetServicePermissions

> Sets permissions on a Service for a Trustee.

Source: https://docs.capaone.com/capainstaller/vb-scripting-library/security-functions/security-setservicepermissions/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

### Description

Sets permissions on a Service for a Trustee

sRight can be one of the following values:

- F: Full Control
- R: Generic Read
- W: Generic Write
- X: Generic Execute
- L: Read Control
- Q: Query Service Configuration
- S: Query Service Status
- E: Enumerate Dependent Services
- C: Service Change Configuration
- T: Start Service
- O: Stop Service
- P: Pause/Continue Service
- I: Interrogate Service
- U: Service User-Defined Control Commands

### Syntax

Security_SetServicePermissions(sService, sTrustee, sRight) As Boolean

### Parameter

#### sService (String)

Name of the Service

#### sTrustee (String)

A trustee is a user or group. Trustee can either be "Domainname/username" or a [Well-known SID's](/capainstaller/vb-scripting-library/addendum/well-known-sid-s/) (Security Identifier) 

#### sRight (String)

Access Right that should be set

### Example

**VBScript**

```vb
If bStatus Then bStatus = Security_SetServicePermissions("Service", "S-1-5-4", "F")
```

[Scripting Guidelines](/capainstaller/vb-scripting-library/scripting-guidelines/)

### Related functions

[Security functions](/capainstaller/vb-scripting-library/security-functions/) [Security_DenyServiceAccess](/capainstaller/vb-scripting-library/security-functions/security-denyserviceaccess/) [Security_RevokeServicePermissions](/capainstaller/vb-scripting-library/security-functions/security-revokeservicepermissions/) [Constants](/capainstaller/vb-scripting-library/addendum/constants/) [Package Property](/capainstaller/vb-scripting-library/addendum/package-property/) [Variables](/capainstaller/vb-scripting-library/addendum/variables/)
