locked
How can I find ssd in registry? RRS feed

  • Question

  • Hi world.
    I need to find a specific ssd in registry, HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\(IDE/AHCI)\(ssd_name)\(serial_number)\Device Parameters\Disk" where I need to put some registry key like UserWriteCacheSetting properly.
    The problem is the ssd is different for each computer. So I need to locate the Interface Guid and then change/add the keys afterwards within that interface.
    Whole computers installed windows 10 should be able to be applied.
    Please give me amazing ideas using batch file or powershell.
    Thank you very much.
    Regards
    Chris
    • Edited by Chris__Lee Wednesday, August 14, 2019 5:03 PM
    Wednesday, August 14, 2019 4:50 PM

Answers

  • You can try this:

    Get-Disk | 
        where model -match 'ssd'| 
            foreach {
                $_.FriendlyName; $_.ObjectId -match '#{(..*?)}"$' | out-null; $matches[1]
            }

    If you don't need the "FriendlyName" then remove it from the example. 


    --- Rich Matheisen MCSE&I, Exchange Ex-MVP (16 years)

    • Proposed as answer by Stoyan ChalakovMVP Thursday, August 15, 2019 7:34 AM
    • Marked as answer by Chris__Lee Thursday, August 15, 2019 8:47 AM
    Wednesday, August 14, 2019 7:05 PM

All replies

  • You can try this:

    Get-Disk | 
        where model -match 'ssd'| 
            foreach {
                $_.FriendlyName; $_.ObjectId -match '#{(..*?)}"$' | out-null; $matches[1]
            }

    If you don't need the "FriendlyName" then remove it from the example. 


    --- Rich Matheisen MCSE&I, Exchange Ex-MVP (16 years)

    • Proposed as answer by Stoyan ChalakovMVP Thursday, August 15, 2019 7:34 AM
    • Marked as answer by Chris__Lee Thursday, August 15, 2019 8:47 AM
    Wednesday, August 14, 2019 7:05 PM
  • Hi,

    The suggestions of Rich is correct, you just need to replace 'ssd' with the Model you are looking for...

    Get-Disk | 
        where model -match 'KBG30ZPZ256G TOSHIBA'| 
            foreach {
                $_.FriendlyName; $_.ObjectId -match '#{(..*?)}"$' | out-null; $matches[1]
            }
    Regards,


    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer" where applicable. This helps the community, keeps the forums tidy, and recognizes useful contributions. Thanks!) Blog: https://blog.pohn.ch/ Twitter: @StoyanChalakov

    Thursday, August 15, 2019 7:37 AM