📜 ⬆️ ⬇️

Inventory it, inventory it: SAM

Not everyone can get pleasure from cleaning, but living in a mess is impossible. So the CIO has to carry out an inventory of the equipment and software acquired over the years in order not to run into Error Code: 418 I'm a teapot.

Yes, there are probably companies that keep their sites in good order, because they have long been concerned about this issue, studied the asset management methodology and took control of the entire life cycle of the IT infrastructure and all software (cout << "Utopia!" << endl;). We will not talk about these workers now. If you are not one of them, we suggest that you look into ways to optimize IT asset management processes. Let's talk about SAM Services and various inventory methods, and we would like to round out on the pivot table with the most commonly used tools and their features.

How was the scene of torture Kovacs. Shot from the series Altered Carbon / “Modified Carbon”

The SAM Services program has recently undergone changes (now not that before, folks). Optimization of infrastructure and workloads, risk assessment and security threats - now projects have become more customized, with or without license optimization. At the exit, the customer will receive a comprehensive personalized report containing recommendations and suggestions for improving the existing infrastructure, and as a bonus - a licensing analysis, saving time and effort to bring the assets to an ideal state.
')
Projects take place in several stages. As you call a ship, it will float, so it’s paramount to decide on goals and objectives, for which it is vital to identify all the "wishes" and "sores" in order to proceed to the next step, knowledge and analysis (this also includes mapping for an optimized environment based on business objectives). And here we come to the final stage, when the customer receives recommendations on optimizing the infrastructure with a legal, economic and, of course, technical justification.

It is recommended to use the following tools for infrastructure surveys - if you are a pro, you can do it at once, because they complement each other perfectly:



All these tools are aimed at one key task - to discover a resource, track its life cycle from the moment of purchase to the release of scrap. It is not necessary to recalculate everything with the hands, respectively, the number of errors due to the human factor is minimized, labor costs for inventory management are reduced, in general, it is very convenient.

One of the most accessible tools (quite free of charge) for infrastructure surveys is MAPT. First of all, let's take a look at this particular pet - we regularly use it in LANIT-Integration projects. When you need to quickly find and minimize risks in the field of information security in the infrastructure, transfer the customer's business processes to the cloud and optimize the existing infrastructure, it is with this solution that we always start work. It is freely distributed and, unlike the others, does not require infrastructure preparation before use. Unfortunately, the MAPT functionality allows only to detect and collect data, therefore it requires the installation of additional tools.

Shot from the series Altered Carbon / “Modified Carbon”

Included with MART is installed SQL 2008 R2 edition of Express. Express edition has a limitation in the database size: 10 GB maximum. So if we are focused on exploring the customer’s large-scale infrastructure, before starting the installation of MART, you must also install the SQL Server edition Standard.

MART helps us in collecting information about the device and its performance, supports Windows and some versions of Unix \ Linux systems. Works as a scanner, as a search range, you can set the subnet IP-addresses, import device names from a file, use Active Directory, SCCM. More clearly:


At the exit, MART allows us to generate reports on the current infrastructure, which can also be used for licensing analysis. However, the latter is more difficult to do, because MART generates many different reports with scattered information, and it takes time to mix them into something digestible. To automate the process, you can use a script (in the application) or execute a SQL query.

application
This script was created to solve the following tasks:

  1. Counting the percentage of inventory devices;
  2. Counting the number of client OS deployments and office products;
  3. Formation of the table with the obtained data in the csv file.

Input data (reports from MART xlsx format):

  1. On devices AD (ActiveDevicesUsageTracker);
  2. By office products (Office)

The output file contains the following tables:

  1. Client operating systems (OS);
  2. Microsoft Office;
  3. Microsoft Visio;
  4. Microsoft Project;

Listing:

$path = "C:\Users\Administrator\Desktop" #################  ####################### $i = $null $j = $null $k = $null [array]$OutputInfoAboutInventMAPT = "Computer Name" + "`t" + "Operating System" + "`t" + "Type" + "`t" + "WMI Status" + "`t" + "Virtual (Y/N)" + "`t" + "Days Since Last Activity" #    [array]$AllActive = "Computer Name" + "`t" + "Operating System" + "`t" + "Type" + "`t" + "WMI Status" + "`t" + "Virtual (Y/N)" + "`t" + "Days Since Last Activity" #     [array]$AllActiveClient = $null #     [array]$InventPC_NoStatistik = $null $objExcel = New-Object -ComObject Excel.Application $WorkBook = $objExcel.Workbooks.Open($path + "\AD.xlsx") $objExcel.visible = $false $WorkSheetMapt = $WorkBook.sheets.item("Device Details") $MaptInventPC = $WorkSheetMapt.Range("A:A").value2 -ne $null $OS = $WorkSheetMapt.Range("C:C").value2 -ne $null $Type = $WorkSheetMapt.Range("D:D").value2 -ne $null $WMIStatus = $WorkSheetMapt.Range("F:F").value2 -ne $null $ActiveDay = $WorkSheetMapt.Range("J:J").value2 -ne $null for ($i = 0; $i -le $MaptInventPC.count; $i++) { if (($ActiveDay[$i] -le 90) -and ($WMIStatus[$i] -eq "Success")) { $OutputInfoAboutInventMAPT += $MaptInventPC[$i] + "`t" + $OS[$i] + "`t" + $Type[$i] + "`t" + $WMIStatus[$i] + "`t" + $ActiveDay[$i] } } $AllSuccess = $OutputInfoAboutInventMAPT[1..$OutputInfoAboutInventMAPT.Count] for ($i = 0; $i -le $MaptInventPC.count; $i++) { if ($ActiveDay[$i] -le 90) { $AllActive += $MaptInventPC[$i] + "`t" + $OS[$i] + "`t" + $Type[$i] + "`t" + $WMIStatus[$i] + "`t" + $ActiveDay[$i] } } $ProcentInventPC = $AllSuccess.count * 100 / $AllActive.count "   " + "`t" + $AllActive.count >> "C:\Users\Administrator\Desktop\Info.csv" "   " + "`t" + $AllSuccess.Count >> "C:\Users\Administrator\Desktop\Info.csv" "% " + "`t" + $ProcentInventPC >> "C:\Users\Administrator\Desktop\Info.csv" ###################     ################################### for ($i = 0; $i -le $MaptInventPC.count; $i++) { if (($ActiveDay[$i] -le 90) -and ($Type[$i] -eq "Client")) { $AllActiveClient += $OS[$i] } } $CountActiveClient = $AllActiveClient | Group-Object | Select-Object -Property Name, Count " " + "`t" + "  " >> "C:\Users\Administrator\Desktop\Info.csv" for ($i=0; $i -le $CountActiveClient.count; $i++) { $CountActiveClient[$i].name + "`t" + $CountActiveClient[$i].count >> "C:\Users\Administrator\Desktop\Info.csv" } $WorkBook.Close() ################## MS Office ########################### [array]$visio = $null [array]$project = $null $WorkBookOffice = $objExcel.Workbooks.Open($path + "\Office.xlsx") $objExcel.visible = $false #     $WorkSheetOffice = $WorkBookOffice.sheets.item("Office2016Assessment") $WorkSheetApp = $WorkBookOffice.sheets.item("OfficeAppSummary") $NameOfficeSuite = $WorkSheetOffice.Range("G:G").value2 -ne $null $AppName = $WorkSheetApp.Range("A:A").value2 -ne $null $AppNumInstallCopie = $WorkSheetApp.Range("D:D").value2 -ne $null "`n" + "`n" + "`n" + "`n" + "MS Office" + "`n" + "" + "`t" + "" >> "C:\Users\Administrator\Desktop\Info.csv" $CountOfficeSuite = $NameOfficeSuite| Group-Object | Select-Object -Property Name, Count for ($i=0; $i -le $CountOfficeSuite.count; $i++) { $CountOfficeSuite[$i].name + "`t" + $CountOfficeSuite[$i].count >> "C:\Users\Administrator\Desktop\Info.csv" } ################# Visio ############################# for ($i = 0; $i -le $AppName.count; $i++) { if (($AppName[$i] -like "*visio*" ) -and ($AppName[$i] -notlike "*viewer*")) { $visio += $AppName[$i] + "`t" + $AppNumInstallCopie[$i-1] } } "`n" + "`n" + "Visio" + "`n" + " " + "`t" + "  " >> "C:\Users\Administrator\Desktop\Info.csv" for ($i=0; $i -le $visio.count; $i++) { $visio[$i] >> "C:\Users\Administrator\Desktop\Info.csv" } ###################### Project ###################### for ($i = 0; $i -le $AppName.count; $i++) { if (($AppName[$i] -like "*project*" ) -and ($AppName[$i] -notlike "*viewer*")) { $project += $AppName[$i] + "`t" + $AppNumInstallCopie[$i-1] } } "`n" + "`n" + "Project" + "`n" + " " + "`t" + "  " >> "C:\Users\Administrator\Desktop\Info.csv" for ($i=0; $i -le $project.count; $i++) { $project[$i] >> "C:\Users\Administrator\Desktop\Info.csv" } 

In the tables AllDevices_Assessment.HardwareInventoryCore, AllDevices_Assessment.HardwareInventoryEx, Core_Inventory.AdDiscoveredDevices, Core_Inventory.Devices, SqlServer_Assessment.SqlInstances and views MAP_External_Access.InstalledProducts.

The second place in terms of accessibility and functionality is shared by SCCM, Altiris, LANDESK, which we decided not so much to disassemble according to the bones, but to demonstrate a variety of tools, so we are looking forward to your edits and comments:


As you can see, there are a number of tools with a huge variety of possibilities, but there are plenty of nuances: some do not work on Debian or Oracle, others do not fully support remote control, etc. But, if we take the average temperature in the hospital, the coverage is mostly the same, and the producers themselves try to keep up with the times, permanently modifying their decisions.

Shot from the series Altered Carbon / “Modified Carbon”

SAM projects have acquired a completely different scale over time, approaching to comprehensive consulting on optimizing and supporting infrastructure and improving information security. Compilation of all used software with actually purchased (licensed analysis) is a project bonus. The main goal is that the customer at the end of the project could himself maintain the ideal order. In the end, nothing compares to a sense of satisfaction at the sight of perfectly tidied and managed land, where the risks of all sorts of threats are minimized and the customer infrastructure is optimized. Welcome to the Brave New World with customization and closed IT gestalts.

All KARMA, and we with my dear co-author dnmnk while we wait for your comments and comments.

Source: https://habr.com/ru/post/354848/


All Articles