Microsoft Intune Deployment

AIT can be deployed as an MSI and then run using PowerShell

Step 1

Go to Apps, Windows apps and Add

 Step 2

Select Line-of-business app

Step 3

Select package app file and select AIT.msi.

You can download this from Here

Step 4

Call it Autodesk Inventory Tool and for Publisher, Autodesk and click Next

Step 5

Add Devices users or groups to the devices to be scanned

Step 6

Create the app will take some time to deploy before performing the next steps

Once AIT has been deployed to endpoints there are now 2 options available.

Further considerations may be needed for setting execution policies 

Option 1 - Email Results

Users do not connect to VPN.

Using the following PowerShell script will run AIT then email results to a specified email.

THIS SCRIPT NEEDS TO BE RUN AS USER

$aitpath="C:\program files (x86)\Autodesk\Autodesk Inventory Tool\AIT.exe"
$computername= $env:computername
Start-Process -FilePath $aitpath -ArgumentList "/c $computername /fp /lu /rp /sl" -WindowStyle Hidden
Start-Sleep 80
rename-item -Path "C:\ProgramData\Autodesk\AIT\DataStore.xml" -NewName "C:\ProgramData\Autodesk\AIT\$computername.xml"

cd "C:\ProgramData\Autodesk\AIT"
$OL = New-Object -ComObject outlook.application
$name = hostname
$loc = (Get-Location).Path
$result = "$loc\$name.xml"

Start-Sleep 5

$mItem = $OL.CreateItem("olMailItem")
#change "[email protected]" to any preferred email address
$mItem.To = "[email protected]"    
$mItem.Subject = "AIT Scan Results"
$mItem.Body = "Results from $name"
$mItem.Attachments.Add($result)
$mItem.Send()
Exit(0) 
Click to copy

To collect the data, Create a folder under Inbox called "AIT Results" and create a rule to move all emails with the subject "AIT Scan Results"


Run the following PowerShell script to extract the Attachments to a folder

 # link to the folder
 # replace "[email protected]" to your email address
 $olFolderPath = "\\[email protected]\Inbox\Personal"

 # set the location to temporary file
 $filePath = "C:\test\"

 # use MAPI name space
 $outlook = new-object -com outlook.application; 
 $mapi = $outlook.GetNameSpace("MAPI");
 $olDefaultFolderInbox = 6
 $inbox = $mapi.GetDefaultFolder($olDefaultFolderInbox) 
 $olTargetFolder = $inbox.Folders | Where-Object { $_.FolderPath -eq $olFolderPath }
 $emails = $olTargetFolder.Items

 # process the emails
 foreach ($email in $emails) {
 $email.Attachments | foreach {
 $fileName = $_.FileName
 $_.saveasfile((Join-Path $filePath $fileName)) 
 } 
 }  
Click to copy

Option 2 - SMB Share

Users have VPN to centrally accessible server.

Using the following script will modify the config file to a specified Path and then run AIT

$filePath = "C:\Program Files (x86)\Autodesk\Autodesk Inventory Tool\AIT.exe.config"
$DataStorePath = '<value>Default</value>'
$UNCPATH = '<value>\\DC01\AIT\DATA\</value>'
$PerComputerDataStore = '<value>False</value>'
$SetToTrue = '<value>True</value>'
$aitPath = "C:\Program Files (x86)\Autodesk\Autodesk Inventory Tool\AIT.exe"
if (Test-Path $filePath) 
        {
        (Get-Content $filePath) |        
            Foreach-Object { $_ -replace $DataStorePath, $UNCPATH } |        
            Foreach-Object { $_ -replace $PerComputerDataStore, $SetToTrue } |        
            Set-Content $filePath
        }
Start-Sleep 20
Start-Process -FilePath $aitPath -ArgumentList "/c localhost /fp /lu /rp /sl" -WindowStyle Hidden
Click to copy