wpietrzakpl / GlpiTools

PowerShell Module to work with Glpi API
15 stars 8 forks source link

get-GlpiToolsComputers #25

Open ludovicbernard opened 2 years ago

ludovicbernard commented 2 years ago

Bonjour, Is it possible with get-GlpiToolsComputers to choose the entity merci, Cordialement,

wpietrzakpl commented 2 years ago

Hi You can do it this way only Get-GlpiToolsComputers -All | Where-Object {$_.entitiesid -eq here place your etitiesid number} in my case it is Get-GlpiToolsComputers -All | Where-Object {$.entities_id -eq 0}

Regards Wojtek

ludovicbernard commented 2 years ago

I have an account that is just super-admin in an entity, as soon as I do the -all request, I have a problem authorizing access to the root entity.

ludovicbernard commented 2 years ago

I have an access problem, my user account is only authorized on a sub-entity, how is it possible to make an "invoke-restmethod" request directly on the sub-entity?

wpietrzakpl commented 2 years ago

You can try with Search-GlpiToolsItems -SearchFor Computer -SearchType contains -SearchField 80 -SearchValue PowershellPlanet SearchFiled = 80 - its entity field SearchValue is the name of entity, in my case it is PowerShellPlanet - replace this with your name

hope this gonna help