30 lines
1.3 KiB
PowerShell
30 lines
1.3 KiB
PowerShell
. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1')))
|
|
# https://knowledge.autodesk.com/search-result/caas/downloads/content/licensing-support-tool.html
|
|
$URL = 'https://knowledge.autodesk.com/sites/default/files/file_downloads/AdskLicensingSupportTool-2.2.0.502-win.zip'
|
|
|
|
# Download the zip archive
|
|
$LicensingSupportTool = Download-File -URL $URL
|
|
|
|
# Extract the downloaded zip file
|
|
Expand-Archive -Path $LicensingSupportTool
|
|
|
|
$WorkingDir = '{0}\{1}' -f (Split-Path -Path $LicensingSupportTool -Parent), "AdskLicensingSupportTool"
|
|
|
|
$ALST = "${WorkingDir}\AdskLicensingSupportTool.exe"
|
|
If ( Test-Path $ALST ) {
|
|
Write-Output "Resetting all Autodesk product licenses to named-user licenses"
|
|
Try { Start-Process $ALST -ArgumentList '-r ALL:User' -Wait }
|
|
Catch { Write-Error $_.Exception.Message }
|
|
}
|
|
|
|
If ( Test-Path $LicensingSupportTool ) {
|
|
Write-Output "Deleting ""${LicensingSupportTool}"""
|
|
Try { Remove-Item $LicensingSupportTool -Force -ErrorAction SilentlyContinue }
|
|
Catch { Write-Error $_.Exception.Message }
|
|
}
|
|
|
|
If ( Test-Path $WorkingDir ) {
|
|
Write-Output "Deleting ""${WorkingDir}"""
|
|
Try { Remove-Item $WorkingDir -Force -Recurse -ErrorAction SilentlyContinue }
|
|
Catch { Write-Error $_.Exception.Message }
|
|
} |