Microsoft Intune Deployment (Microsoft Intune のデプロイ)

AIT は MSI としてデプロイし、PowerShell を使用して実行することができます。

手順 1

[Apps](アプリ)[Windows apps](Windows アプリ)[Add](追加)の順に移動します。

手順 2

[Line-of-business app] を選択します。

手順 3

[Select app package file](アプリ パッケージ ファイルを選択)を選択し[AIT.msi] を選択します。

こちらからダウンロードできます。

手順 4

これを Autodesk Inventory Tool と呼び、Publisher には Autodesk と入力して [Next](次へ)をクリックします。

手順 5

スキャンするデバイスにデバイス ユーザまたはグループを追加します。

手順 6

アプリの作成には、次の手順を実行する前にデプロイするのに少し時間がかかります。

AIT がエンドポイントにデプロイされた後は、2 つのオプションを使用できるようになります。

実行ポリシーの設定には、さらなる検討が必要となる場合があります。

オプション 1 - 結果を電子メールで送信

ユーザは VPN に接続しません。

次の PowerShell スクリプトを使用すると、AIT が実行され、指定した電子メールに結果が送信されます。

このスクリプトはユーザとして実行する必要があります

$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 "ENTERYOUREMAIL@autodesk.com" to any preferred email address
$mItem.To = "ENTERYOUREMAIL@autodesk.com"    
$mItem.Subject = "AIT Scan Results"
$mItem.Body = "Results from $name"
$mItem.Attachments.Add($result)
$mItem.Send()
Exit(0) 
Click to copy

データを収集するには、[受信トレイ]の下に「AIT Results」というフォルダを作成し、「AIT Scan Results」という件名のすべての電子メールを移動するルールを作成します。


次の PowerShell スクリプトを実行して、添付ファイルをフォルダに抽出します。

 # link to the folder
 # replace "youremail@company.com" to your email address
 $olFolderPath = "\\youremail@company.com\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

オプション 2 - SMB 共有

ユーザは VPN で一元的にアクセスできるサーバに接続します。

次のスクリプトを使用して、config ファイルを指定したパスに変更し、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