A set of scripts to create an inventory report using PowerShell, SQL and WPF
- SQL Server
- PowerShell V3
- Necessary rights to pull information from remote servers
- Necessary rights to run a scheduled task for data gathering
- PoshRSJob module to assist with data gathering
-
Either on the SQL server or on a system that has access to the SQL server where the database and tables will reside on, run the Invoke-ServerInventorySQLBuild.ps1 script, ensuring that you have updated the SQL database location (Computername parameter on line 4).
-
You will need to provide the account that is being used in the scheduled task the necessary rights to be able to write to the ServerInventory database that is created.
-
You can run the Invoke-ServerInventoryDataGathering.ps1 prior to implementing it as a scheduled task to enusre that there are no access issues both with the data gathering and the shipping of data to the SQL server. Again, you will need to update the script to point to the SQL server.
-
Once you are sure that everything looks good, you can create a scheduled task to run this script nightly or whenever you feel is appropriate.
-
Ensure that Start-ServerInventoryUI.ps1 has been updated to point to your SQL server and also make sure that you have allowed the users that will be using the UI has read access to the database to allow the UI to populate the datatables correctly.