Files
management-scripts/Fix-AutodeskProductLicensing.ps1
T
2021-05-03 12:52:10 -04:00

23 lines
1.0 KiB
PowerShell

$URL = 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/resources/AdskLicensingSupportTool.exe'
$LicensingSupportTool = Download-File -URL $URL
$WorkingDir = Split-Path -Path $LicensingSupportTool -Parent
If ( Test-Path $LicensingSupportTool ) {
LogMsg "Extracting Autodesk Licensing Support Tool to ""${WorkingDir}"""
Try { Start-Process "${LicensingSupportTool}" -ArgumentList "-o""${WorkingDir}"" -y" -WorkingDirectory $WorkingDir -Wait }
Catch { LogErr $_.Exception.Message ; Exit }
}
$ALST = "${WorkingDir}\AdskLicensingSupportTool\AdskLicensingSupportTool.exe"
If ( Test-Path $ALST ) {
LogMsg "Resetting all Autodesk product licenses to named-user licenses"
Try { Start-Process $ALST -ArgumentList '-r ALL:USER' -Wait }
Catch { LogErr $_.Exception.Message }
}
If ( Test-Path $LicensingSupportTool ) {
LogMsg "Deleting ""${LicensingSupportTool}"""
Try { Remove-Item $LicensingSupportTool -Force -ErrorAction SilentlyContinue }
Catch { LogErr $_.Exception.Message }
}