Good morning, first of all I apologize for any spelling mistakes, I am using a translator.
Since now I hope that everything is fine with everyone who sees this post, and here is my situation.
In my job I am a server administrator and I am now starting to enter the world of powershell, of which, I understand very little. And I want to make a complete inventory of the machines that I have in network in the company, I know that there is a script in powershell that can do this to me, I already researched a lot and I was never able to find what I really needed, so I am using this forum.
The idea was a script that would give me information about the version of the office you have installed, the amount of RAM memory, the size and free space you have on disk, the model and name of the computer and its respective serial number (way of viewing whether it is a laptop or desktop) and also the peripherals ie mouse keyboard and monitors, with their models and serial number if possible. Also have a user who is currently on the computer. And in the end, export to an excel file.
Something a little like the print that I made available in the post. This I achieved through the website spiceworks.com which has an inventory option, so it does not meet all my needs and I have to install an agent which does not facilitate the process.
I found an example of a script that a colleague previous to me had made and it is something like this. The problem is that my colleague does not know where the script is. But it was something he wanted.
Welcome to the forums. What kind of help do you need? Most of your requirements are easily possible. But there are literally thousands of examples for tasks like this. Even here on this forum. Another great source for Powershell code is the https://www.powershellgallery.com
We will be happy to assist with code you wrote by yourself but we will not write the code for you.
I did a lot of research, for a few good days before writing this post, I didn’t find what I wanted and then, I don’t have so much ease in manipulating code to adapt some code to this need. I already found code that shows disk space but all of this was only locally for one machine and I was never able to export or gather the information
It is pretty unlikely that you will find something perfectly fitting for your particular needs. But if don’t like to learn to do it yourself and if you don’t like to hire a trained IT professional to do it for you you’re pretty much out of luck, sorry.
I took a QUICK look at the script you linked from the PS Gallery. At first glance, it looks like it will do most of what you want. This might get you started. Keep in mind, the AssetInventory script uses PowerShell remoting so you need to figure that out and make sure you run the script as an admin user for all the systems you want to query. Also, I HAVE no way to extensively test this, but an initial test worked for me with the script below.
Download the package you reference ( I am guessing you have done this already), then extract to a folder. You could install the module as instructed on the web site, however, I think you can learn better this way.
In that folder, create a file with the hostnames (one per line) that you want to query. Call the file “hosts.txt”
Then, using this very crude example of a starter script below, create this script in the same folder as the PSM1 and the hosts.txt file. Save it to file name of your liking, then run it. As an example, I saved the file as “Get-Inventory.PS1”. If you choose that same file name, in an admin powershell as a user with admin permissions on all the hosts in your list, enter the following: “.\Get-Inventory.PS1”. This assumes you have set your ExecutionPolicy to “RemoteSigned”.
From there, you are on your own as the output formats can be configured as XML or JSON. Have a look at the arguments for that. I also have to say, the AssetInventory Module is very well written. Kudos to the guy that wrote it.