Should I use user's SID on HKEY_USERS?
Yes.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I am trying to remove remotely Outlook profile. I am local admin in my company.
When I use Invoke-Command:
Invoke-Command -ComputerName $currentPC -ScriptBlock {remove-item -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Profiles"}
I'm getting the following error:
Cannot find path 'HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Profiles' because it does not exist.
I run the script with admin rights, so I have a feeling that scriptblock cannot identify HKEY_USERS for current user who is logged on remote machine
and somehow points to my registry entries. How can I make this script work?
Should I use user's SID on HKEY_USERS? Tanks
Should I use user's SID on HKEY_USERS?
Yes.
Hi,
HKCU is a symbolic link to a key representing the active user under HKEY_USERS key and the information in this key is built during the logon process. You can specify a user account with the -credential parameter.
Best Regards,
Ian Xue
-----------------------------
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hello
Thank you for your question and reaching out. I can understand you are having issues related to Outlook profile.
From Outlook 2013 (which supports side-by-side installations), the profiles are stored in HKEY_CURRENT_USER\Software\Microsoft\Office\%version%\Outlook\Profiles, where %version% is 15.0 for Outlook 2013, 16.0 for Outlook 2016, etc. In your Script try to change to this path with user context may be with logon script.
--If the reply is helpful, please Upvote and Accept as answer--