How can I programmatically find a users HKEY_USERS registry key using powershell?

后端 未结 3 654
-上瘾入骨i
-上瘾入骨i 2021-02-04 05:58

I wonder if there is a way to find a local user\'s registry key in HKEY_USERS if you know the login-name of that user on the local machine. I want to programmatically add stuff

3条回答
  •  耶瑟儿~
    2021-02-04 06:28

    This does it for me

    ls 'hklm:software/microsoft/windows nt/currentversion/profilelist' | ? {
      $_.getvalue('profileimagepath') -match 'Steven'
    } | % pschildname
    

    Example

提交回复
热议问题