Skip to content

Commit a7858c6

Browse files
authored
New and Improved!
1 parent 5e8d895 commit a7858c6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Powershell/Add-UserRights.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ PROCESS
112112
[Parameter(Position = 1)]
113113
[Alias('user')]
114114
[array]$Username = ("{0}\{1}" -f $env:USERDOMAIN, $env:Username),
115-
[Parameter(Position = 2)]
115+
[Parameter(Mandatory = $true,
116+
Position = 2)]
116117
[ValidateSet('SeBatchLogonRight', 'SeInteractiveLogonRight', 'SeNetworkLogonRight', 'SeRemoteInteractiveLogonRight', 'SeServiceLogonRight', 'SeDenyBatchLogonRight', 'SeDenyInteractiveLogonRight', 'SeDenyNetworkLogonRight', 'SeDenyRemoteInteractiveLogonRight', 'SeDenyServiceLogonRight', IgnoreCase = $true)]
117118
[Alias('right')]
118119
[array]$UserRight
@@ -190,12 +191,12 @@ PROCESS
190191
{
191192
foreach ($user in $Username)
192193
{
193-
Add-UserRights -ComputerName $ComputerName -Username $user -UserRight $right
194+
Add-UserRights -ComputerName $ComputerName -Username $user -UserRight $UserRight
194195
}
195196
}
196197
else
197198
{
198-
<# Edit line 202 to modify the default command run when this script is executed.
199+
<# Edit line 203 to modify the default command run when this script is executed.
199200
Example:
200201
Add-UserRights -UserRight SeServiceLogonRight, SeBatchLogonRight -ComputerName $env:COMPUTERNAME, SQL.contoso.com -UserName CONTOSO\User1, CONTOSO\User2
201202
#>

0 commit comments

Comments
 (0)