Issue with storing and retrieving registry key stored in HKLM

158 Views Asked by At

I store a credential in HKLM:/Software/test path and then consume it later for authorization.

I am facing an issue here where sometimes it returns the exact value that I have set, and sometimes it returns a different value. But I can't check the exact registry keys since I don't have physical access of that machine.

So couple of questions around this- a) Can there be two HKLM accounts in a machine? According to all the docs online, No. But I can't think of any other way to justify this. I am not caching the value explicitly, not sure if windows does that internally. b) I have also observed that sometimes the flow fails to retrieve that registry key(the test-path commandlet returns false) but for a very short duration, and then it starts returning the correct value again. Does anyone have any context on this? Can it be related to regedit writes? If yes, what's the recommended fix then?

Can someone please help me here? I am running out of options now.

0

There are 0 best solutions below