Sorry, missed out the bit to set Network Licence.... and unable to edit original post!!!!
I use PSADT to deploy this to computers via SCCM, important parts of script below, Place the Tools .zip file in Files folder
[CmdletBinding()]
Param (
[Parameter(Mandatory=$false)]
[ValidateSet('Install')]
[string]$DeploymentType = 'Install',
[Parameter(Mandatory=$false)]
[ValidateSet('Interactive','Silent','NonInteractive')]
[string]$DeployMode = 'Silent',
[Parameter(Mandatory=$false)]
[switch]$AllowRebootPassThru = $false,
[Parameter(Mandatory=$false)]
[switch]$TerminalServerMode = $false,
[Parameter(Mandatory=$false)]
[switch]$DisableLogging = $true,
[Parameter(Mandatory=$false)]
[switch]$InstallLang = $false,
[Parameter(Mandatory=$false)]
[ValidateSet('USER','NETWORK','STANDALONE','NONE')]
[string]$Mode = 'USER'
)
If ($deploymentType -ieq 'Install') {
if(!(test-path $dirFiles\AdskLicensingSupportTool)){
Expand-Archive "$dirFiles\AdskLicensingSupportTool-1.1.0.116-win.zip" -DestinationPath "$dirFiles" -Force
}
$Util = "$dirFiles\AdskLicensingSupportTool\AdskLicensingSupportTool.exe"
function Set-Env ($action)
{
if($action -eq 'add'){
$LicServer = $envCOMPUTERNAME.Substring(0,2)
### ** first 2 letters of host name
### ****** HostName of existing FlexNet servers
switch ($LicServer) {
** {$LicServer = "*******";break}
** {$LicServer = "*******";break}
default {$LicServer = "*********"}
}
[scriptblock]$HKCURegistrySettings = {
remove-RegistryKey -Key 'HKCU\Software\FLEXlm License Manager' -Name 'ADSKFLEX_LICENSE_FILE' -SID $UserProfile.SID
}
Invoke-HKCURegistrySettingsForAllUsers -RegistrySettings $HKCURegistrySettings
[System.Environment]::SetEnvironmentVariable("ADSKFLEX_LICENSE_FILE","@$LicServer",[System.EnvironmentVariableTarget]::Machine)
[System.Environment]::SetEnvironmentVariable('FLEXLM_TIMEOUT',10000000,[System.EnvironmentVariableTarget]::Machine)
} else {
[System.Environment]::SetEnvironmentVariable('ADSKFLEX_LICENSE_FILE',$null,[System.EnvironmentVariableTarget]::Machine)
[System.Environment]::SetEnvironmentVariable('FLEXLM_TIMEOUT',$null,[System.EnvironmentVariableTarget]::Machine)
}
}
switch ($mode)
{
'USER' {Execute-Process -Path $Util -Parameters '-r ALL:USER';Set-Env ;break}
'NETWORK' {Execute-Process -Path $Util -Parameters '-r ALL:NETWORK';Set-Env add;break}
'STANDALONE' {Execute-Process -Path $Util -Parameters '-r ALL:STANDALONE';Set-Env ;break}
'NONE' {Execute-Process -Path $Util -Parameters '-r ALL:NONE';Set-Env ;break}
Default {Execute-Process -Path $Util -Parameters '-r ALL:NONE';Set-Env}
}
Exit-Script -ExitCode $mainExitCode
}
}
Catch {
[int32]$mainExitCode = 60001
[string]$mainErrorMessage = "$(Resolve-Error)"
Write-Log -Message $mainErrorMessage -Severity 3 -Source $deployAppScriptFriendlyName
Show-DialogBox -Text $mainErrorMessage -Icon 'Stop'
Exit-Script -ExitCode $mainExitCode
}
I deploy this under package model - Deploy Application.ps1 is saved as ACAD_LicSwitch.ps1
Program:
Deploy-Application.exe ACAD_LicSwitch.ps1 -Mode USER