< Back

Grant-CServicePermission

Sun Jan 12, 2020 10:10 pm

NAME Grant-CServicePermission



SYNOPSIS

Grants permissions for an identity against a service.





SYNTAX

Grant-CServicePermission -Name <String> -Identity <String> -FullControl [<CommonParameters>]



Grant-CServicePermission -Name <String> -Identity <String> [-QueryConfig] [-ChangeConfig] [-QueryStatus]

[-EnumerateDependents] [-Start] [-Stop] [-PauseContinue] [-Interrogate] [-UserDefinedControl] [-Delete]

[-ReadControl] [-WriteDac] [-WriteOwner] [<CommonParameters>]





DESCRIPTION

By default, only Administators are allowed to manage a service. Use this function to grant specific identities

permissions to manage a specific service.



If you just want to grant a user the ability to start/stop/restart a service using PowerShell's `Start-Service`,

`Stop-Service`, or `Restart-Service` cmdlets, use the `Grant-ServiceControlPermissions` function instead.



Any previous permissions are replaced.





PARAMETERS

-Name <String>

The name of the service to grant permissions to.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Identity <String>

The identity to grant permissions for.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-FullControl [<SwitchParameter>]

Grant full control on the service



Required? true

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-QueryConfig [<SwitchParameter>]

Grants permission to query the service's configuration.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-ChangeConfig [<SwitchParameter>]

Grants permission to change the service's permission.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-QueryStatus [<SwitchParameter>]

Grants permission to query the service's status.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-EnumerateDependents [<SwitchParameter>]

Grants permissionto enumerate the service's dependent services.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Start [<SwitchParameter>]

Grants permission to start the service.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Stop [<SwitchParameter>]

Grants permission to stop the service.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-PauseContinue [<SwitchParameter>]

Grants permission to pause/continue the service.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Interrogate [<SwitchParameter>]

Grants permission to interrogate the service (i.e. ask it to report its status immediately).



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-UserDefinedControl [<SwitchParameter>]

Grants permission to run the service's user-defined control.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Delete [<SwitchParameter>]

Grants permission to delete the service.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-ReadControl [<SwitchParameter>]

Grants permission to query the service's security descriptor.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-WriteDac [<SwitchParameter>]

Grants permission to set the service's discretionary access list.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-WriteOwner [<SwitchParameter>]

Grants permission to modify the group and owner of a service.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Grant-CServicePermission -Identity FALCON\\Chewbacca -Name Hyperdrive -QueryStatus -EnumerateDependents

-Start -Stop



Grants Chewbacca the permissions to query, enumerate dependents, start, and stop the `Hyperdrive` service.

Coincedentally, these are the permissions that Chewbacca nees to run `Start-Service`, `Stop-Service`,

`Restart-Service`, and `Get-Service` cmdlets against the `Hyperdrive` service.











RELATED LINKS

Get-CServicePermission

Grant-ServiceControlPermissions





Name : Initialize-Lcm

Category : Alias

Synopsis : Initialize-CLcm

Component :

Role :

Functionality :