I recently posted an article about iPad AirPlay screen mirroring. Part of that article recommends an application called AirServer which allow you to mirror your iPad’s screen to a Mac or PC. One problem with the software is that AirServer stores its activation and password settings within the currently logged on user’s profile, so when another user logs on the software is no longer activated and the password is removed. Here is how you resolve the problem.
In the article I mentioned that we had created a script to centrally manage AirServer password and activation, and since then a number of people have contacted me for the code. So, here it is!
Note: This article is only relevant to versions of AirServer prior to 1.9.1.
Export the Activation Code
- First install and activate AirServer on a the Windows PC you require AirServer.
- Open REGEDIT.EXE and navigate to [HKEY_CURRENT_USER\Software\AirServer]
- Copy the registry keys for “TCOEA” and “ActivationCode”, we’ll need these later.
Once you have these two strings (“TCOEA” and “ActivationCode”) you can simply import them into the registry of any other Windows PC and they will activate AirServer. The problem is that this only works for the currently logged on user. If another user logs on to the PC the software will no longer be activated and the password will be cleared.
In order to automate this process we created a script.
AirServer Activation and Password Script
Note: If you activate AirServer on a second PC the first will become deactivated.
The following code allows you to enter the AirServer activation code and password for multiple PCs and automatically import it into the registry. By running the script at logon via Group Policy the settings can be applied per user. This process also has the advantage that you can change passwords in the script and they will change on the PC the next time a user logs on.
Copy the code below into a text editor, such as Notepad, and save as a .vbs file. Make sure to edit the script in the indicated places.
'AirServer central activation and password configuration script 'From ClassThink.com Set fso = CreateObject("Scripting.FileSystemObject") 'Checks that AirServer is installed. If not the script will not run. If (fso.FileExists("C:\Program Files (x86)\AirServer\AirServer\AirServer.exe")) Then Set objNet = CreateObject("WScript.Network") strCompName = objNet.ComputerName 'Sets password for computers without the software installed strPassword = "NOT ALLOWED TO USE THIS SOFTWARE" 'Sets the password for Computers with the application installed. Name has to be in caps. 'Replace Computer1, Computer2 with the name of the computers you want to affect. 'Add additional lines for more computers. IF strCompName = "COMPUTERNAME1" THEN strPassword = "password1" END IF IF strCompName = "COMPUTERNAME2" THEN strPassword = "password2" END IF Const HKEY_CURRENT_USER = &H80000001 strComputer = "." Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv") strKeyPath = "SOFTWARE\AirServer\Updates" objRegistry.CreateKey HKEY_CURRENT_USER, strKeyPath strKeyPath = "SOFTWARE\AirServer" strValueName = "Password" dwValue = strPassword objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue 'declare settings fault finding only 'WScript.Echo HKEY_CURRENT_USER & strKeyPath & strValueName & dwValue & strPassword & strCompName strActivate = "NOT ALLOWED TO USE THIS SOFTWARE" 'The following line activates the software. Enter the activation code you exported above. IF strCompName = "COMPUTER1" THEN strActivate = "ENTER THE EXPORTED ACTIVATION CODE HERE" END IF IF strCompName = "COMPUTER2" THEN strActivate = "ENTER THE EXPORTED ACTIVATION CODE HERE" END IF 'Set product key dwValue2 = "3TT45472CU7340357" IF strActivate = "NOT ALLOWED TO USE THIS SOFTWARE" then dwValue2 = "NOT ALLOWED TO USE THIS SOFTWARE" strKeyPath2 = "SOFTWARE\AirServer" strValueName2 = "TCOEA" objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath2, strValueName2, dwValue2 'fault finding 'WScript.Echo strActivate & dwValue2 'set activation key strKeyPath3 = "SOFTWARE\AirServer" strValueName3 = "ActivationCode" dwValue3 = strActivate objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath3, strValueName3, dwValue3 'skip version strKeyPath4 = "SOFTWARE\AirServer\Updates" strValueName4 = "SkipThisVersion" dwValue4 = "1.1.8" objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath4, strValueName4, dwValue4 Else WScript.Quit() End If WScript.Quit()