Browsing Posts in Add-ons

Currently, LOGINventory5 MMC-Application does not support the GetDate()-function in quiries like LOGINventory 4. If you want to get all assets with a scandate 30 days ago you can now use the Windows PowerShell. You just have to execute following script:

ScandateBefore30Days.ps1:

 
# Read all LOGINventory CmdLets from Registry and add them to the current session
cd HKLM:\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns
Get-ChildItem | where {$_.Name -like "*Login.Ventory.*"} | select Name | foreach {add-pssnapin $_.Name.SubString($_.Name.LastIndexOf('\')+1)}
 
# Create LOGINventory Drive change location
$d = new-psdrive -scope global -name LI -PSProvider LOGINventory -root ""
 
cd LI:\Assets
 
# perhaps you have to set the correct culture information for the Convert.ToDateTime-function of .NET
$CULTURE = New-Object System.Globalization.CultureInfo("de-DE")
function isBefore([int]$days, [string]$date)
{
   $scandate = [Convert]::ToDateTime($date, $CULTURE)
   [DateTime]::Compare([DateTime]::Now.AddDays($days).Date, $scandate.Date) -eq 1
}
 
get-LiResults | Where {isBefore -30 $_.scandatetime}

Now you can execute the job:

powershell.exe [location]\ScandateBefore30Days.ps1

You want to do a scheduled export of your query results? Look here…

You have just to save the following script and the txt-file below. The text file contains the path of the query node from the LMC application and the target file separated with a “|”-character.
Sample:
Analyse\myQuery|C:\myResult.csv

ATTENTION: To use this simple script the query names in the LMC have to contain only “normal” characters ([a-z],[A-Z],[0-9])! Spaces are allowed but you have to replace them with a “_”-character in the “Queries.txt” (See the example)!

ExportQueries.ps1:

# Read Query-File-List
param([string]$file)
$queries = Get-Content $file
 
# Read all LOGINventory CmdLets from Registry and add them to the current session
cd HKLM:\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns
Get-ChildItem | where {$_.Name -like "*Login.Ventory.*"} | select Name | foreach {add-pssnapin $_.Name.SubString($_.Name.LastIndexOf('\')+1)}
 
# Create LOGINventory Drive change location
$d = new-psdrive -scope global -name LI -PSProvider LOGINventory -root ""
 
# Execute CSV-Export for each query
$queries | foreach {
	$path = $_.Split("|")[0];
	$target = $_.Split("|")[1];
 
	cd LI:\$path;
	Get-LiResults | Export-Csv $target;
}

Queries.txt:

Analyse\Samples\Stopped_Autorun_Services|C:\stoppedservices.csv
Analyse\Samples\Remote_Desktop_Users|C:\remoteusers.csv

Now you can execute the job:

powershell.exe [location]\ExportQueries.ps1 [location]\Queries.txt

Build 3560 (17.05.2010)

Features:

  • Storage-Support improved

 

Build 3554 (13.05.2010)

Features:

  • Navigation thru LOGINventory Data via a PowerShell Provider
  • Script all your recurring analysis
  • Send results per mail
  • Read or Write Manual Properties
  • Generate Reports
  • Supports Symbolic Links (experimental Feature)

BugFixes:

  • Refresh-Bug fixed
  • Report-Bug fixed

Please download here

LOGINventory5 PowerShell Provider RC1 is now available!

The LOGINventory5 PowerShell Add-on provides a full scripting interface for Windows PowerShell 2.0. It enables the user to selectively access, process and manage all of the information in the LOGINventory5 data base. The Add-on consists of a PowerShell Provider for navigating the LOGINventory5 tree structure and several CommandLets to cover specific functions (reporting, emailing, setting Manual Properties etc.) which are subject to continuous development. LOGINventory5 PowerShell scripts can be executed on a regular basis via Scheduled Tasks to realize functions as “email me a list with license violations on a daily basis”.
Example:
PS LI:\License_Management> Get-LiResults | where {$_.needed -gt
$_.available} | Send-LiMail

It’s that easy!

Please download here

Features:

  • Please read the German oder English Manual in the Download-Package

Known Bug:

  • Perhaps there are a few problems with the Save-LiReport-CmdLet

Requirements:

  • min. LOGINventory 5.1.5