Skip to content

Conversation

@danhutchings
Copy link

@danhutchings danhutchings commented May 26, 2022

In its current state, CPE::Helpers.logged_on_user_sid returns nil on Windows Server 2019 because CPE::Helpers.logged_on_user_sid is searching for a registry value LastLoggedOnUserSID in CPE::Helpers.logged_on_user_registry that doesn't exist in that version of the operating system. To fix this, the code is being refactored to use PowerShell command to retrieve the SID of the current logged in user. This code also works with earlier versions of Windows Server and Windows 10 endpoints.

What type of PR is this?
/kind bug

What this PR does / why we need it:
Without this, Windows Server 2019 will return nil for CPE::Helpers.logged_on_user_sid

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:
This will require a Windows Server 2019 host to test on

Does this PR introduce a user-facing change?:

NONE

Additional documentation e.g., Design Proposals, usage docs, etc.:


In its current state, the  returns  on Windows Server 2019 because the  is searching for a registry value that doesn't exist in that version of the operating system. To fix this, the code is being refactored to use PowerShell command to retrieve the SID of the current logged in user.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants