Answer the question
In order to leave comments, you need to log in
Is Software Inventory and Exporting Data to Excel Possible via PowerShell?
I apologize in advance, maybe for stupid questions and dumb things, I'm not a magician, I'm just learning ....
The point is, there is a park of computers in the corporate domain. it is necessary to make an inventory of programs on computers, it is not possible to install and even more so purchase software. The idea came to make a PowerShell script that will pull information from the registry and throw it into the table. Scatter the script on computers and throw the result into a folder, then collect it in a heap through Excel. But I ran into a couple of problems, since there is little experience in PowerShell.
1) I know how to see the name of the computer, but I still haven’t figured out how to save the file with the name of this computer ....
2) there are 2 scripts, the 1st one displays information about the software on the PC, it is more than satisfied, the second one looks and writes down the information about the hardware. BUT, it didn't work for me to force the second script to take information from the registry and write to the file.
I don’t ask for the finished code, although I don’t refuse, I’ll read it, I’ll figure it out, I think =) I throw both scripts in their original form, as I found on the forums. here, rather, a couple of points, how to pull out the info from the array and force it to write to a column and how to write a variable to the file name
I tried to write to a table like this
# DeviceID
$LogiclDisk.Cells.Item($Row, $Column) = $temp | Select-Object -Property DisplayName
$Column++
# DeviceID
$LogiclDisk.Cells.Item($Row, $Column) = -Massive ( $temp | Select-Object -Property DisplayName)
$Column++
but something went wrong ... please don’t throw a lot of tomatoes, but at least direct where to dig ...
Answer the question
In order to leave comments, you need to log in
1. There are plenty of such scripts on the net. This is already a trivial task. The search yields a wealth of information. The second on request "Powershell software inventory" is a century-old Khabrov article - Inventory of computers in a domain. Laziness-engine ... well, etc., etc.
2. Why bother with Excel COM objects?? Isn't it easier to save everything in a CSV file and then do whatever you want with it?
3. Why scatter the script on computers, if you can pick up the information remotely?
Well, you know, if you don’t figure out how to save a file with a computer name, then maybe you should stop writing your own script, and use ready-made solutions?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question