Closed ludovicbernard closed 5 years ago
Hi, Thank you for comment :) I assume, you have computer name and you want to get ID of that computer.
This is the situation which I decribed in #6 , I think there is solution :)
ok thanks for the glpi view, I found a way to do it, here is the method $ rall = get-glpitoolscomputer -all $ rcomputer = $ rall | select name, id | where {$ _. name -match "computer"}
$ computer.id
thanks for super glpitools
Yes, you can do it like that, It's another approach :) maybe not that fast like search function but...
the goal is to find the MAC of the computer. that she is the command that allows to do that ?
Look, you can get Computer object with parameter "WithNetworkPorts"
$t = Get-GlpiToolsComputers -ComputerId id
And you will get All informations about network on desired Computer Here is mac property
yes nickel, how to find the arguments "_networkports.NetworkPortEthernet "?
if we have more than one network interface, it takes what interface ?
Under the variable $t is Computer object, using . (dot) you reffer to parameters :) $t | Get-Member gives you better view on available parameters ;)
It gives you back All interfaces
ok, on the computer, I have
Look how I have: $t = Get-GlpiToolsComputers -ComputerId id -Raw -Parameter WithNetworkports Then $t._networkports And
And you will see all network interfaces of computer After that you have to filter the results for interface you want (Where-Object)
ok , merci. with the formcreator plugin, does it exist an API?
Not in mine, maybe later I will implement commands for FormCreator, but this is the future :)
I will follow this module glpitools because it is really very good, nice job. strongly the future.
Thank you :) I think we can close the issue
How to have the computerid with only computername?