Skip to content
This repository has been archived by the owner. It is now read-only.

Commit 1386665

Browse files
authored
Merge pull request #272 from HubbleStack/win32_user-fix
win_secedit win32 fixes
2 parents 757ef8b + 16301d7 commit 1386665

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

hubblestack_nova/win_secedit.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,13 @@ def _secedit_import(inf_file):
264264
def _get_account_sid():
265265
'''This helper function will get all the users and groups on the computer
266266
and return a dictionary'''
267-
win32 = __salt__['cmd.run']('Get-WmiObject win32_useraccount | Format-List -Property '
268-
'Name, SID', shell='powershell', python_shell=True)
267+
win32 = __salt__['cmd.run']('Get-WmiObject win32_useraccount -Filter "localaccount=\'True\'"'
268+
' | Format-List -Property Name, SID', shell='powershell',
269+
python_shell=True)
269270
win32 += '\n'
270-
win32 += __salt__['cmd.run']('Get-WmiObject win32_group | Format-List -Property Name, '
271-
'SID', shell='powershell', python_shell=True)
271+
win32 += __salt__['cmd.run']('Get-WmiObject win32_group -Filter "localaccount=\'True\'" | '
272+
'Format-List -Property Name, SID', shell='powershell',
273+
python_shell=True)
272274
if win32:
273275

274276
dict_return = {}

0 commit comments

Comments
 (0)