win_security_policy - add warning when using this module ot edit rights (#48850)

This commit is contained in:
Jordan Borean 2018-11-20 09:21:28 +10:00 committed by GitHub
parent 7692882db3
commit 9b0dd5224b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- win_security_policy - warn users to use win_user_right instead when editing ``Privilege Rights``

View file

@ -134,6 +134,10 @@ Function ConvertFrom-Ini($file_path) {
return $ini return $ini
} }
if ($section -eq "Privilege Rights") {
Add-Warning -obj $result -message "Using this module to edit rights and privileges is error-prone, use the win_user_right module instead"
}
$will_change = $false $will_change = $false
$secedit_ini = Export-SecEdit $secedit_ini = Export-SecEdit
if (-not ($secedit_ini.ContainsKey($section))) { if (-not ($secedit_ini.ContainsKey($section))) {

View file

@ -36,6 +36,8 @@ options:
- Example sections to use are 'Account Policies', 'Local Policies', - Example sections to use are 'Account Policies', 'Local Policies',
'Event Log', 'Restricted Groups', 'System Services', 'Registry' and 'Event Log', 'Restricted Groups', 'System Services', 'Registry' and
'File System' 'File System'
- If wanting to edit the C(Privilege Rights) section, use the
M(win_user_right) module instead.
required: yes required: yes
key: key:
description: description: