Powershell and deleting registry keys RRS feed

  • Question

  • Hi

    I can't figure out why Powershell (v3) is cranky with me. I used the web examples provided and it is not happy .

    OK so a

    > get-Item -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Network Associates\ePolicyOrchestrator\Agent' works

    However a get or remove Item or ItemProperty does NOT work

    I tried both full path and 'keypath -Name item' no joy

    I want to remove - Remove-Item-Path'Registry::HKLM:\SOFTWARE\Wow6432Node\Network Associates\ePolicy Orchestrator\Agent\AgentGUID'

    >> How do I win ? Thanks

    Tuesday, April 1, 2014 1:40 AM


All replies

  • Hi,

    Try this, this is working for me:

    Remove-ItemProperty 'HKLM:\SOFTWARE\Wow6432Node\Network Associates\ePolicy Orchestrator\Agent' -Name AgentGUID

    Don't retire TechNet! - (Don't give up yet - 12,700+ strong and growing)

    • Marked as answer by Greg B Roberts Wednesday, April 2, 2014 12:52 AM
    Tuesday, April 1, 2014 1:59 AM
  • Don't you just love McAfee.  ePO is such a beautiful Mind "F".

    The key doesn't exist.

    Don't bother with all of that.

    Do this:

    Test-Path 'HKLM:\SOFTWARE\Wow6432Node\Network Associates\ePolicy Orchestrator\Agent\AgentGUID'

    It is easier to use the predefined drives "HKLM:" and "HKCU".

    help registry


    • Edited by jrv Tuesday, April 1, 2014 2:01 AM
    Tuesday, April 1, 2014 2:00 AM
  • If it returns "true" then use this:
    Remove-ItemProperty <path> <item>


    Tuesday, April 1, 2014 2:03 AM
  • Thanks, that was the final permutation that worked!!

    For any one creating images , AgentGUID & the mac address need to be deleted prior to sysprep else new machine has have internal mcafee id, sucks, you think they could work it out if is different...

    Thanks for the Test-Path trick

    Thanks again

    Wednesday, April 2, 2014 12:54 AM
  • Hi Jrv,  I'm trying to delete this key but using your command it is returning false when I can see it in Registry Editor!  I have tried all kinds of permission sets, taking ownership of the Agent key and sub keys, making sure I run everything as the local administrator but still no luck!

    We are using Windows 10 x64 with McAfee Agent 5.0.2 and VSE 8.8 Patch 6.

    I know this is years old but I need to get this image finished but can't delete the key!


    Wednesday, February 10, 2016 3:44 PM
  • Please open a new topic with a clear statement of your problem and any error messages.


    Wednesday, February 10, 2016 4:16 PM