Cameyo utilizes Temporary user profiles designed to be cleared of all personal user data upon closure of a session.


In some cases, Administrators may look to recreate these Temporary user profiles.


  1. Download the script (attachment) named CameyoRecreateUsers.ps1
  2. Or Paste the following into your Powershell session:
    POWERSHELL:
    Add-Type -AssemblyName System.Windows.Forms
    $isAdmin = (New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
    $max = 50
     
    if ($isAdmin) {
        for ($u=1; $u -le $max; $u++) {
            Write-Progress -Activity "Deleting user profiles" -Status "Deleting user profile $u of $max" -PercentComplete ($u*100/$max)
            Get-CimInstance -ClassName Win32_UserProfile | Where-Object { $_.LocalPath.EndsWith("RemoteUser$u") } |  Remove-CimInstance -ErrorAction SilentlyContinue
            Get-LocalUser -Name "RemoteUser$u" | Remove-LocalUser -ErrorAction SilentlyContinue
        }
        Write-Progress -Activity "Recreating user profiles" -Status "Recreating users..."
        Start-Process -FilePath "c:\RemoteAppPilot\RemoteAppPilot.exe" -ArgumentList "-CreateUsers" -Wait 
        Write-Host "Done"
    } else {
        [System.Windows.Forms.MessageBox]::Show("You need to run this script as an Administrator","Action not permitted",0,[System.Windows.Forms.MessageBoxIcon]::Exclamation)
    } 


  3.  This will complain if the script isn’t run as the Administrator

  4. Successful execution of the script will present the following screen:
    Or: