Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

$(Computer:TARGETHOSTNAME) and rest of the variables

Hello,

There are variables in Inventory which can be used for creating custom tools, i.e:

  • $(Computer:TARGETHOSTNAME)
  • $(Computer:TARGETMACADDRESS)
  • $(Computer:TARGETOSNAME)

Is this possible to access the same way the rest of data gathered by scanners? I tried to get the  $(Computer:TARGETCURRENTUSER) variable but it doesn't seem to work.

I just want to use data gathered by scanners. For example:

So, if it's possible to get target's MAC address, it should be possible to get the rest of data and use it as desired. Is this possible to access it as variables and use in 'Tools' ? 

PS.

Using things like %username% or even

$loggedIn = $(Get-WMIObject -class Win32_ComputerSystem | Select-Object username).username

does not help me at all. Please do not post similar suggestions.

Kind Regards, Jaromir

 

2

Comments

1 comment
Date Votes
  • Unfortunately, that is not possible. Those variables are hard-coded. There are no hidden variables.

    However, if you are creating a Local Tool, you can retrieve your desired fields from the database.

    ((PDQInventory.exe GetComputer $(Computer:TARGETHOSTNAME) | Select-String 'Current User') -split ':').Trim()[1]

    From my module PdqStuff:

    Get-PdqInventoryComputerData -Name $(Computer:TARGETHOSTNAME) -Table Computers -Columns CurrentUser
    0