Skip to main content

Rename Windows Hostname based FileWave Client Name

Description

This Fileset renames a Windows computer so its Windows hostname matches the FileWave Client Name shown in FileWave Admin.

With this Fileset associated, the FileWave Client Name becomes the source of truth. If the Windows hostname is changed directly in Windows, Active Directory, or another tool, the Fileset changes it back to the FileWave Client Name the next time the rename workflow runs.

Use a FileWave Client Name that follows the Windows computer naming conventions. The scripts check the name before attempting a rename. If the name is invalid, they log the reason, exit with code 4, and make no change. A name is rejected if it:

  • is longer than 15 characters (the NetBIOS limit)
  • contains spaces, underscores, dots, or special characters such as \ / : * ? " < > | , ~ ! @ # $ % ^ & ' ( ) { }
  • is made up entirely of digits

Good name examples:

  • FILEWAVE-PC
  • TCE-3453234
  • PRINT-SRV

Bad name examples:

  • Jerry's Desktop Computer
  • GO_BEARS!
  • THISNAMEISMUCHLONGERTHAN15CHARACTERS

Ingredients

Older batch-file versions are still attached for reference, but the PowerShell Filesets are the current examples to start from:

Requirements

  • The script must run elevated, as SYSTEM (FileWave default) or an administrator. It exits with code 6 if it doesn’t. Don’t try to run it as a standard user.
  • Domain-joined machines need a reachable domain controller (on-network or VPN) and a domain account permitted to rename computer objects.

Machines not joined to Active Directory

  1. Download, unzip, and import the Windows - Rename Windows Hostname (No Domain) PowerShell Fileset into FileWave Admin.
  2. Associate the Fileset with the Windows devices that should follow their FileWave Client Name.
  3. Rename the device in FileWave Admin.
  4. Update Model.
  5. Wait for the client to check in and run the Fileset. The included workflow is designed around the normal FileWave preflight/tickle timing.
  6. The user receives a reboot prompt, and the device reboots after the configured timeout.
  7. The Windows hostname is changed to the FileWave Client Name after reboot.
  8. FileWave Client communication is not affected by the rename.

Machines joined to Active Directory

Domain-joined renames need domain credentials, which the Fileset reads from two environment variables:

Variable Value
user A domain account in DOMAIN\username or username@domain.fqdn format. A bare username is accepted, but the script appends @<your domain> and logs a warning.
pass The account’s password

The script performs the whole rename in a single process. It does not write a second script or save the password to disk, and the password is never written to the log.

  1. Download, unzip, and import the Windows - Rename Windows Hostname (Domain Joined) PowerShell Fileset into FileWave Admin.
  2. Set the user and pass environment variables for your environment. Access this by opening the fileset, select the script, choose 'Get Info', then Executable and Environment Variables:

    Screenshot 2026-10-15 at 12.41.33 PM.png

  3. Test with a small group first. Domain-joined renames depend on Active Directory permissions, DNS/domain health, and the reboot completing successfully.
  4. Associate the Fileset with the Windows devices that should follow their FileWave Client Name.
  5. Rename the device in FileWave Admin.
  6. Update Model.
  7. Wait for the client to check in and run the Fileset.
  8. The user receives a reboot prompt, and the device reboots after the configured timeout.
  9. The Windows hostname is changed to the FileWave Client Name after reboot.
  10. FileWave Client communication is not affected by the rename.

Logging and troubleshooting

Each run appends to a log on the client:

C:\ProgramData\FileWaveRename\rename.log

The log records:

  • The account the script ran as, whether it was elevated, process bitness, and PowerShell version
  • Whether the machine is domain-joined, and the domain name
  • Every value found under the FileWave registry key, checked in both the 32-bit and 64-bit registry views
  • The active, pending, and desired computer names
  • For domain-joined machines: a domain controller lookup, a secure channel test, and a credential check against Active Directory
  • The result of Rename-Computer and the reboot scheduling, including full error details and a hint on failure

Exit codes

Code Meaning
0 Name already correct, or a rename is already pending a reboot
1 Could not read fwUser from the registry
2 Renamed successfully, reboot scheduled
3 Rename-Computer failed (see log)
4 Invalid computer name
5 Domain-joined, but user/pass environment variables are missing
6 Not running elevated

Common log findings

Log shows Likely cause and fix
Admin/elevated: False The Fileset isn’t running as SYSTEM/admin. Change the FileWave script’s run-as setting if you set one.
Credential validation against AD: False Wrong password, locked account, or username format. Try DOMAIN\user or user@domain.fqdn.
Validation True, but “Access is denied” on rename The account is valid but lacks rights on the computer object. Delegate rename permissions on that OU.
nltest or secure channel failures, “domain controller” or “RPC” errors The machine can’t reach a DC. Check VPN/network and DNS.
Key not found or an empty fwUser value The FileWave Client Name isn’t populated on the client. Confirm the device was renamed in Admin and the model was updated.
Exit code 4 The Client Name is invalid. Rename the device in FileWave Admin using a compliant name.

Customize the reboot prompt or timeout

The PowerShell Filesets include the reboot prompt and timeout in the imported script, on this line:

shutdown.exe /r /t 60 /c "Computer renamed to $fwClientName. Rebooting in 60 seconds." /f /d p:4:1

Change the /t 60 value for the timeout in seconds, and update the text after /c if you want the user prompt to say something different. If you change the timeout, update “60 seconds” in the message to match. The older batch-file Filesets use the same command, with %fwClientName% in place of $fwClientName.

Sync Computer Name
When a client is manually renamed in FileWave Admin, FileWave disables Sync Computer Name for that client. That allows the Fileset to apply the FileWave Client Name to Windows instead of having Windows immediately sync its old computer name back into FileWave.