ps/Modules/Alkami.PowerShell.Services/Public/Grant-UserLogonAsServiceRights.ps1
2023-05-30 22:51:22 -07:00

20 lines
487 B
PowerShell

function Grant-UserLogonAsServiceRights {
<#
.SYNOPSIS
Grants a User the Logon as a Service Right
#>
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$userName
)
$logLead = (Get-LogLeadName);
Grant-UserLocalSecurityPolicyRights $userName "SeServiceLogonRight"
$secPolLogContent = Get-Content (Join-Path $env:windir "security\logs\scesrv.log")
$secPolLogContent | ForEach-Object { Write-Verbose ("$logLead : {0}" -f $_)}
}