Category: Servers (Page 1 of 2)

Renaming Device with command prompt in Atera

If you want to rename a device in Atera without opening the device through cmd

click Manage dropdown

Click run as System command prompt

Type: wmic computersystem where name=”%COMPUTERNAME%” call rename name=”NEWCOMPUTERNAME”

Hit return

Type in the console shutdown /r /t 0

Hit return

Reload Atera after the computer has restarted the computer should be renamed

SharePoint Migration Lessons Learned

Sharepoint Migration Lessons Learned

Revised by: Andrae 12/20/24

Validated multiple different scenarios as a dry run using the Ultrex Test MS365 Tenant.

Lessons Learned:

–              If a folder / file is owned by User 1 in OneDrive and User 1 has shared contents to User 2 with edit permissions (didn’t test with view permissions), and then User 1 is unlicensed/deleted, from User 2’s OneDrive you can still move files/folders into a Sharepoint site that User 2 is a site member of w/ edit permissions as well, by using OneDrive’s “Move To” company sharepoint site function.

o   The value of this is that file version history will move across with the contents to the Sharepoint site.

–              Sharepoint Migration tool is the best tool to use if you have files locally synced on the computer you want to upload from. But since this is essentially creating a copy of those files (if downloading from OneDrive), then you’ll lose file version history and will be uploading a fresh copy into the sharepoint site you need.

When name files / sharepoint sites, plan how you will be syncing the files to your users’ devices. Sharepoint sites will display name in the following order: “Document Library Name – Sharepoint Site Name”. For example in MPP’s it will show as “Shared – Accounting”. Then if you’re having users look in separate spots for where files are living (i.e. OneDrive for items owned by you, and Sync to Device for Sharepoint Sites that will show up in a separate line in File Explorer outside of the OneDrive live), it needs to be clear which library is for which site since you only have so much room.

If having users “Add Shortcut to OneDrive”, make sure to just select the Document Library tab and say “Add Shortcut to OneDrive” without highlighting any of the subfolders, and this will add the Full Parent Library folder in a top level folder in OneDrive. Avoids having to select each folder and say “Add Shortcut to OneDrive” and clutter OneDrive with a million unclearly named folders.

How to uninstall the Atera agent by Powershell Script

How to uninstall the Atera agent by Powershell Script 

https://support.atera.com/hc/en-us/articles/5849002658844-How-do-I-remove-the-Atera-Agent-after-my-trial-has-expired

Regarding your query, what I would recommend, after you rename the PC, make sure to reboot it.  

After that, I would recommend to run the following script using PowerShell ISE as admin, locally :  

https://support.atera.com/hc/en-us/articles/5849002658844-How-do-I-remove-the-Atera-Agent-after-my-trial-has-expired

Once the script is finished, reboot the device again. In order for the registry keys to be removed / updated, reboot would be needed.  

After this, I would recommend using the CMD installation method instead of .MSI in order to install Atera Agent and assign it to the right customer. 

Function Get-UninstallCodes ([string]$DisplayName) { 

‘HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall’, ‘HKLM:SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall’ | ForEach-Object { 

Get-ChildItem -Path $_ -ErrorAction SilentlyContinue | ForEach-Object { 

If ( $(Get-ItemProperty -Path $_.PSPath -Name ‘DisplayName’ -ErrorAction SilentlyContinue) -and ($(Get-ItemPropertyValue -Path $_.PSPath -Name ‘DisplayName’ -ErrorAction SilentlyContinue) -eq $DisplayName) ) { 

$str = (Get-ItemPropertyValue -Path $_.PSPath -Name ‘UninstallString’) 

$UninstallCodes.Add($str.Substring(($str.Length – 37),36)) | Out-Null 

Function Get-ProductKeys ([string]$ProductName) { 

Get-ChildItem -Path ‘HKCR:Installer\Products’ | ForEach-Object { 

If ( $(Get-ItemProperty -Path $_.PSPath -Name ‘ProductName’ -ErrorAction SilentlyContinue) -and ($(Get-ItemPropertyValue -Path $_.PSPath -Name ‘ProductName’ -ErrorAction SilentlyContinue) -eq $ProductName) ) { 

$ProductKeys.Add($_.PSPath.Substring(($_.PSPath.Length – 32))) | Out-Null 

Function Get-ServiceStatus ([string]$Name) { (Get-Service -Name $Name -ErrorAction SilentlyContinue).Status } 

Function Stop-RunningService ([string]$Name) { 

If ( $(Get-ServiceStatus -Name $Name) -eq “Running” ) { Write-Output “Stopping : ${Name} service” ; Stop-Service -Name $Name -Force } 

Function Remove-StoppedService ([string]$Name) { 

$s = (Get-ServiceStatus -Name $Name) 

If ( $s ) { 

If ( $s -eq “Stopped” ) { 

Write-Output “Deleting : ${Name} service” 

Start-Process “sc.exe” -ArgumentList “delete ${Name}” -Wait 

} Else { Write-Output “Not Found: ${Name} service” } 

Function Stop-RunningProcess ([string]$Name) { 

$p = (Get-Process -Name $_ -ErrorAction SilentlyContinue) 

If ( $p ) { Write-Output “Stopping : ${Name}.exe” ; $p | Stop-Process -Force } 

Else { Write-Output “Not Found: ${Name}.exe is not running”} 

Function Remove-Path ([string]$Path) { 

If ( Test-Path $Path ) { 

Write-Output “Deleting : ${Path}” 

Remove-Item $Path -Recurse -Force 

} Else { Write-Output “Not Found: ${Path}” } 

Function Get-AllExeFiles ([string]$Path) { 

If ( Test-Path $Path ) { 

Get-ChildItem -Path $Path -Filter *.exe -Recurse | ForEach-Object { $ExeFiles.Add($_.BaseName) | Out-Null } 

# Mount HKEY_CLASSES_ROOT registry hive 

New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null 

####### 

# START: Information gathering 

####### 

# Get MSI package codes from the uninstall key 

$UninstallCodes = New-Object System.Collections.ArrayList 

‘AteraAgent’, ‘Splashtop for RMM’, ‘Splashtop Streamer’ | ForEach-Object { Get-UninstallCodes -DisplayName $_ } 

# Get product keys from the list of installed products 

$ProductKeys = New-Object System.Collections.ArrayList 

‘AteraAgent’, ‘Splashtop for RMM’, ‘Splashtop Streamer’ | ForEach-Object { Get-ProductKeys -ProductName $_ } 

# Define all the directories we’ll need to cleanup at the end of this script 

$Directories = @( 

“${Env:ProgramFiles}\ATERA Networks”, 

“${Env:ProgramFiles(x86)}\ATERA Networks”, 

“${Env:ProgramFiles}\Splashtop\Splashtop Remote\Server”, 

“${Env:ProgramFiles(x86)}\Splashtop\Splashtop Remote\Server”, 

“${Env:ProgramFiles}\Splashtop\Splashtop Software Updater”, 

“${Env:ProgramFiles(x86)}\Splashtop\Splashtop Software Updater”, 

“${Env:ProgramData}\Splashtop\Splashtop Software Updater” 

# Get all possible relevant exe files so we can make sure they’re closed later on 

$ExeFiles = New-Object System.Collections.ArrayList 

“${Env:ProgramFiles}\ATERA Networks” | ForEach-Object { Get-AllExeFiles -Path $_ } 

# Define a list of services we need to stop and delete (if necessary) 

$ServiceList = @( 

‘AteraAgent’, 

‘SplashtopRemoteService’, 

‘SSUService’ 

# Define a list of registry keys we’ll delete 

$RegistryKeys = @( 

‘HKLM:SOFTWARE\ATERA Networks’, 

‘HKLM:SOFTWARE\Splashtop Inc.’, 

‘HKLM:SOFTWARE\WOW6432Node\Splashtop Inc.’ 

####### 

# END: Information gathering 

####### 

# Uninstall each MSI package code in $UninstallCodes 

$UninstallCodes | ForEach-Object { Write-Output “Uninstall: ${_}” ; Start-Process “msiexec.exe” -ArgumentList “/X{${_}} /qn” -Wait } 

# Stop services if they’re still running 

$ServiceList | ForEach-Object { Stop-RunningService -Name $_ } 

# Terminate all relevant processes that may still be running 

$ExeFiles.Add(‘reg’) | Out-Null 

$ExeFiles | ForEach-Object { Stop-RunningProcess $_ } 

# Delete services if they’re still present 

$ServiceList | ForEach-Object { Remove-StoppedService -Name $_ } 

# Delete products from MSI installer registry 

$ProductKeys | ForEach-Object { Remove-Path -Path “HKCR:Installer\Products\${_}” } 

# Unmount HKEY_CLASSES_ROOT registry hive 

Remove-PSDrive -Name HKCR 

# Delete registry keys 

$RegistryKeys | ForEach-Object { Remove-Path -Path $_ } 

# Delete remaining directories 

#Write-Host “Waiting for file locks to be freed” ; Start-Sleep -Seconds 4 

$Directories | ForEach-Object { Remove-Path -Path $_ } 

Human Google Interface

HGI – Human-Google Interface

This includes more than most people will use often, but

here’s my list for the next batch of Windows admins to

save and pass around:

sysdm.cpl System Properties (to rename computer and

join domain)

dssite.msc Active Directory sites and services

dsa.msc Active Directory users and computers

appwiz.cpl Add/Remove programs

compmgmt.msc Computer management

timedate.cpl Date/Time management

devmgmt.msc Device Manager

dhcpmgmt.msc DHCP Management

cleanmgr Disk Cleanup Utility

diskmgmt.msc Disk Management

desk.cpl Display Settings

dnsmgmt.msc DNS Server Management

eventvwr.msc Event Viewer

lusrmgr.msc Local user and groups manager

mmc.exe Microsoft Management Console

main.cpl Mouse settings

ncpa.cpl Network adapter settings

powercfg.cpl Power Configuration

intl.cpl Regional Settings

services.msc Services

fsmgmt.msc Shared Folder Management

firewall.cpl Windows Firewall

wf.msc Windows Firewall Advanced

compmgmt.msc

Control + Win + Shift + B to “restart” your GPU driver.

Crtl windows key + v you get clipboard with a gui

.cpl and .msc shortcuts.

Man my life changed with those lol.

appwiz.cpl – Add or Remove Programsncpa.cpl – Network Connections

secpol.msc – Local Security Policy

sysdm.cpl – System Properties

If you are looking at a folder in Windows Explorer, click

into the path box, type cmd and hit enter. Command

prompt opens in that folder.

(Also, it finds an unfixed bug where you can’t access the

path box until you go to another folder and come back)

NEVER SLEEP AGAIN – Keep machine awake, kill all power saving/sleep/hibernate

To keep a machine awake forever, turning off all power saving/sleep settings, just paste this into command line.

powercfg /change monitor-timeout-ac 0 & powercfg /change monitor-timeout-dc 0 & powercfg /change standby-timeout-ac 0 & powercfg /change standby-timeout-dc 0 & powercfg /change hibernate-timeout-ac 0 & powercfg /change hibernate-timeout-dc 0

Tested in powershell, doesn’t work

Tested/verified working on windows 11, both local command line, and atera remote command line. 

Or just download and run caffeine

Powershell Script to Collect Bitlocker Recovery Key

Create this powershell script:

# Ensure the BitLocker module is imported

Import-Module BitLocker

# Retrieve all BitLocker volumes

$bitLockerVolumes = Get-BitLockerVolume

# Iterate through each BitLocker-protected volume

foreach ($volume in $bitLockerVolumes) {

    $mountPoint = $volume.MountPoint

    $keyProtector = $volume.KeyProtector | Where-Object { $_.KeyProtectorType -eq ‘RecoveryPassword’ }

    $recoveryPassword = $keyProtector.RecoveryPassword

    if ($recoveryPassword) {

        Write-Output “Drive $mountPoint – Recovery Password: $recoveryPassword”

    } else {

        Write-Output “Drive $mountPoint does not have a recovery password protector.”

    }

}

Fixing a windows cloned drive that you need to expand the main partition, but can’t

This video is pretty well perfect for this task:

If you’ve already cloned the drive, but now you’ve got wasted extra space, but you can’t extend the partition because there’s a windows recovery partition in the way. The video linked walks you through it perfectly.

Here’s how you fix that:

command line:

reagentc /disable

diskpart

list partition

select partition x

detail partition

delete partition override

Re-create the Recovery Partition

list partition

select partition x

set id=

gpt attributes=

list volume

select volume y

remove letter=y

exit

reagentc /enable

Note: x=disk or partition number, y=volume letter.

Powershell Windows Activation

Updated command for Windows 10/11 as of 2/20/26 –

Run Powershell as an administrator, copy and paste the code below and hit enter.  Windows should activate using Option 1 for most Windows OS’s, but use TSForge Option if you need to license a Server install. This can also be used to push through an office install.

NOTE: Only use this at the approval of a supervisor. If we overuse this without the correct licensing as its foundation, we risk a customer being set up for issues in an audit. This command is to be used when Windows fails to activate a license that we know its supposed to activate, often after a Return to OOBE for Entra/Intune Enrollment.

Use the one below for most reliable resolution of get.activated.win in Ultrex Office

iex (curl.exe -s –doh-url https://1.1.1.1/dns-query https://get.activated.win | Out-String)

The following are alternative options if the one above doesn’t work (use your mobile hotspot if needed) –

Option 1:

irm https://get.activated.win | iex

Option 2:

irm https://massgrave.dev/get | iex

If none of the options above work, use this code in powershell administrator mode instead:

if ($ExecutionContext.SessionState.LanguageMode.value__ -ne 0) {
    $ExecutionContext.SessionState.LanguageMode
    Write-Host "Windows PowerShell is not running in Full Language Mode."
    Write-Host "Help - https://massgrave.dev/fix_powershell" -ForegroundColor White -BackgroundColor Blue
    return
}

function Check3rdAV {
    $avList = Get-CimInstance -Namespace root\SecurityCenter2 -Class AntiVirusProduct | Where-Object { $_.displayName -notlike '*windows*' } | Select-Object -ExpandProperty displayName
    if ($avList) {
        Write-Host '3rd party Antivirus might be blocking the script - ' -ForegroundColor White -BackgroundColor Blue -NoNewline
        Write-Host " $($avList -join ', ')" -ForegroundColor DarkRed -BackgroundColor White
    }
}

function CheckFile { 
    param ([string]$FilePath) 
    if (-not (Test-Path $FilePath)) { 
        Check3rdAV
        Write-Host "Failed to create MAS file in temp folder, aborting!"
        Write-Host "Help - https://massgrave.dev/troubleshoot" -ForegroundColor White -BackgroundColor Blue
        throw 
    } 
}

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$URLs = @(
    'https://raw.githubusercontent.com/massgravel/Microsoft-Activation-Scripts/37ec96504a2983a5801c43e975ab78c8f9315d2a/MAS/All-In-One-Version-KL/MAS_AIO.cmd',
    'https://dev.azure.com/massgrave/Microsoft-Activation-Scripts/_apis/git/repositories/Microsoft-Activation-Scripts/items?path=/MAS/All-In-One-Version-KL/MAS_AIO.cmd&versionType=Commit&version=37ec96504a2983a5801c43e975ab78c8f9315d2a',
    'https://git.activated.win/massgrave/Microsoft-Activation-Scripts/raw/commit/37ec96504a2983a5801c43e975ab78c8f9315d2a/MAS/All-In-One-Version-KL/MAS_AIO.cmd'
)

foreach ($URL in $URLs | Sort-Object { Get-Random }) {
    try { $response = Invoke-WebRequest -Uri $URL -UseBasicParsing; break } catch {}
}

if (-not $response) {
    Check3rdAV
    Write-Host "Failed to retrieve MAS from any of the available repositories, aborting!"
    Write-Host "Help - https://massgrave.dev/troubleshoot" -ForegroundColor White -BackgroundColor Blue
    return
}

# Verify script integrity
$releaseHash = '49CE81C583C69AC739890D2DFBB908BDD67B862702DAAEBCD2D38F1DDCEE863D'
$stream = New-Object IO.MemoryStream
$writer = New-Object IO.StreamWriter $stream
$writer.Write($response)
$writer.Flush()
$stream.Position = 0
$hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($stream)) -replace '-'
if ($hash -ne $releaseHash) {
    Write-Warning "Hash ($hash) mismatch, aborting!`nReport this issue at https://massgrave.dev/troubleshoot"
    $response = $null
    return
}

# Check for AutoRun registry which may create issues with CMD
$paths = "HKCU:\SOFTWARE\Microsoft\Command Processor", "HKLM:\SOFTWARE\Microsoft\Command Processor"
foreach ($path in $paths) { 
    if (Get-ItemProperty -Path $path -Name "Autorun" -ErrorAction SilentlyContinue) { 
        Write-Warning "Autorun registry found, CMD may crash! `nManually copy-paste the below command to fix...`nRemove-ItemProperty -Path '$path' -Name 'Autorun'"
    } 
}

$rand = [Guid]::NewGuid().Guid
$isAdmin = [bool]([Security.Principal.WindowsIdentity]::GetCurrent().Groups -match 'S-1-5-32-544')
$FilePath = if ($isAdmin) { "$env:SystemRoot\Temp\MAS_$rand.cmd" } else { "$env:USERPROFILE\AppData\Local\Temp\MAS_$rand.cmd" }
Set-Content -Path $FilePath -Value "@::: $rand `r`n$response"
CheckFile $FilePath

$env:ComSpec = "$env:SystemRoot\system32\cmd.exe"
Start-Process -FilePath $env:ComSpec -ArgumentList "/c """"$FilePath"" $args""" -Wait
CheckFile $FilePath

$FilePaths = @("$env:SystemRoot\Temp\MAS*.cmd", "$env:USERPROFILE\AppData\Local\Temp\MAS*.cmd")
foreach ($FilePath in $FilePaths) { Get-Item $FilePath | Remove-Item }

Once powershell is successful, a command prompt window will open and give you multiple options.  Select option 1 if you only need the version of  Windows activated.  If you need to change the product type, there should be an option to do so in the same command dialogue box

Install Winget on machines that don’t have it

✅ Step-by-Step Installation via PowerShell

  1. Open PowerShell as AdministratorEnsure you’re running PowerShell with administrative privileges.
  2. Set Execution Policy (if not already set)This allows the script to run:
    powershell
    CopyEditSet-ExecutionPolicy RemoteSigned -Scope Process -Force
  1. Install the winget-install Script
    This script automates the installation of WinGet and its dependencies:
    powershell
    CopyEditInstall-Script -Name winget-install -Force
    If prompted to install the NuGet provider or trust the repository, respond with ‘Yes’ or ‘Y’.
  2. Run the Installation Script
    Execute the script to install WinGet:
    powershell
    CopyEditwinget-install.ps1
    This will download and install all necessary components, including dependencies like Microsoft.UI.Xaml and Microsoft.VCLibs.
  3. Verify the Installation
    After completion, confirm that WinGet is installed:
    powershell
    CopyEditwinget --version
    You should see the installed version number displayed.

« Older posts

© 2026 Ultrex Staff

Theme by Anders NorenUp ↑