diff --git a/itchef/cookbooks/cpe_helpers/libraries/cpe_helpers.rb b/itchef/cookbooks/cpe_helpers/libraries/cpe_helpers.rb index 1d58b0eb..47d7c70e 100644 --- a/itchef/cookbooks/cpe_helpers/libraries/cpe_helpers.rb +++ b/itchef/cookbooks/cpe_helpers/libraries/cpe_helpers.rb @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # - +include Chef::Mixin::PowershellOut module CPE class Helpers LOGON_REG_KEY = @@ -269,7 +269,8 @@ def self.last_logged_on_user_from_registry end def self.logged_on_user_sid - logged_on_user_registry['LastLoggedOnUserSID'] + ps_cmd = "Get-LocalUser -Name \"#{logged_on_user_name}\" | Select-Object SID | % { $_.SID.Value }" + powershell_out(ps_cmd).stdout.strip end def self.ldap_lookup_script(username)