Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client Inventory #108

Open
astrugatch opened this issue Apr 27, 2019 · 8 comments
Open

Client Inventory #108

astrugatch opened this issue Apr 27, 2019 · 8 comments

Comments

@astrugatch
Copy link

astrugatch commented Apr 27, 2019

Per the requests : https://forums.fogproject.org/topic/12506/client-inventory-option & https://forums.fogproject.org/topic/12096/allow-client-to-pull-inventory-information-without-pxe-booting

I am running mostly Windows 10 (1607 and 1803 Enterprise and Education) machines and would like to pull inventory from machines that have the client but have not run through imaging or the inventory process in Fos.

I have found some PowerShell scripts but most require AD binding and/or admin credentials. Neither are a deal breaker for my environment, but may be for others.

https://gist.github.com/BDollar/5455098#file-powershell-wmi-inventory-a

https://gallery.technet.microsoft.com/scriptcenter/PowerShell-Hardware-f99336f6

EDIT

The script from gist works with a loopback address so it could be run locally but still needs admin access. Not sure if this is helpful

@astrugatch
Copy link
Author

I don't know if there is a way to poll msinfo (system information) most of the data that shows up in inventory is there under system summary

@astrugatch
Copy link
Author

@astrugatch
Copy link
Author

Another option (thinking more cross platform) would be some sort of integration with https://osquery.io/ There would be prereqs for the fog admin, but would be a more unified base for fog to tap, though I suppose this wouldn't be strictly a fog client feature but more of a fog server feature.

@Sebastian-Roth
Copy link
Member

@astrugatch Nice, you found some interesting stuff there. So far I only had a quick look.

@schmittjoseph What do you think about adding inventory data gathering to fog-client?

@Sebastian-Roth
Copy link
Member

@astrugatch Sorry, still not have had the time to work on this. It's still on the list but not enough time.

@darksidemilk
Copy link
Member

Included in the powerhsell module fogapi (https://www.powershellgallery.com/packages/FogApi) I have a get-foginventory and set-foginventory function. The get one doesn't get what is currently in fog (I should probably have one that does that too...) but uses powershell/wmi to get all the inventory that is tracked in fog and puts it in a format compatible to send to fog for that host through the api. Then you have the set command which runs that get command and sets it on the host running the command in fog

https://github.com/FOGProject/fog-community-scripts/blob/master/PowershellModules/FogApi/FogApi/Public/Set-FogInventory.ps1

https://github.com/FOGProject/fog-community-scripts/blob/master/PowershellModules/FogApi/FogApi/docs/Set-FogInventory.md

https://github.com/FOGProject/fog-community-scripts/blob/master/PowershellModules/FogApi/FogApi/Public/Get-FogInventory.ps1

https://github.com/FOGProject/fog-community-scripts/blob/master/PowershellModules/FogApi/FogApi/docs/Get-FogInventory.md

Perhaps the code already there can help? It can already be used to create an automated solution with scheduled tasks or group policy or something of that sort.

@darksidemilk
Copy link
Member

If someone wanted to help me make the powershell fogapi inventory commands become crossplatform I wouldn't even be mad

@darksidemilk
Copy link
Member

To convert the existing code for getting the windows inventory information. I found this documentation
https://docs.microsoft.com/en-us/windows/win32/wmisdk/retrieving-a-class
https://docs.microsoft.com/en-us/windows/win32/wmisdk/connecting-to-wmi-remotely-with-c-

Looks like it might not be too hard to create something that gets the inventory information in c#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants