locked
trying to get value of server in the following registry setting RRS feed

  • Question

  • invoke-command -computer ottmsg004 -scriptblock {get-itemproperty -path HKLM:\SOFTWARE\Veritas\NetBackup\CurrentVersion\Config}

    I get the following

    Exclude                            : {C:\Program Files\Veritas\NetBackup\bin\*.lock, C:\Program Files\Veritas\NetBackup\bin\bprd.d\*.lock, C:\Program
                                         Files\Veritas\NetBackup\bin\bpsched.d\*.lock, C:\Program Files\Veritas\NetBackupDB\data\*...}
    Server                             : {dc2-p-nbkm-1, cbsnbk001, alvnbk001, alvnbk002...}
    BPBACKUP_POLICY                    : any
    BPBACKUP_SCHED                     : any
    BPARCHIVE_POLICY                   : any
    BPARCHIVE_SCHED                    : any
    VERBOSE                            : 0
    RESTORE_RETRIES                    : 0
    LIST_FILES_TIMEOUT                 : 300
    DISALLOW_SERVER_FILE_WRITES        : NO
    ALLOW_NON_RESERVED_PORTS           : YES
    CRYPT_OPTION                       : ALLOWED
    CRYPT_STRENGTH                     : DES_40
    Debug_Database                     : 0

    I when I query I just want  Server values

    What would be the right syntax to query the registry value?

    Friday, March 29, 2019 5:20 PM

Answers

  • (get-itemproperty -path HKLM:\SOFTWARE\Veritas\NetBackup\CurrentVersion\Config).Server

    Note that it's an array.
    Saturday, March 30, 2019 2:26 PM

All replies

  • Use "select-object" to get the value you want.


    \_(ツ)_/

    Friday, March 29, 2019 6:13 PM
  • Can you give me  an example   of the script should look like

    Saturday, March 30, 2019 11:42 AM
  • I can give you a whole lot of examples.  Start here:  Microsoft Virtual   Academy - Getting Started with Microsoft PowerShell

    \_(ツ)_/

    Saturday, March 30, 2019 2:02 PM
  • (get-itemproperty -path HKLM:\SOFTWARE\Veritas\NetBackup\CurrentVersion\Config).Server

    Note that it's an array.
    Saturday, March 30, 2019 2:26 PM
  • Hi,

    Thanks for your question.

    For example,

    Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\.NETFramework\Advertised\Policy\AppPatch\v2.0.50727.00000\BTSNTSvc.exe\{CA109828-7CE7-40F4-AD73-C7575455A7D5}' | Select-Object pschildname

    https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/select-object?view=powershell-6

    Read cmdlet help file is a good way to learn how to use cmdlet.

     Best regards,

    Lee


    Just do it.

    Monday, April 1, 2019 6:33 AM
  • thank you I got what I needed
    Monday, April 1, 2019 12:54 PM
  • Hi,
    Was your issue resolved? 
    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.
    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.
    If no, please reply and tell us the current situation in order to provide further help.
    Best Regards,
    Lee

    Just do it.

    Monday, April 1, 2019 1:00 PM
  • Hi There

    Please use this command to get only the server values.Thanks

    (Get-ItemProperty -path "HKLM:\SOFTWARE\Veritas\NetBackup\CurrentVersion\Config") | Select
    
    Server


    Regards,

    Ramabadran

    Please dont forget to click Propose as answer it will be useful for others.

    Monday, April 1, 2019 2:05 PM
  • Hi There

    Please use this command to get only the server values.Thanks

    (Get-ItemProperty -path "HKLM:\SOFTWARE\Veritas\NetBackup\CurrentVersion\Config") | Select
    
    Server


    Regards,

    Ramabadran

    Please dont forget to click Propose as answer it will be useful for others.


    Monday, April 1, 2019 3:43 PM