A hostname uniquely identifies a device on a network for communication using Domain Name System (DNS). When you install the ̽»¨´óÉñ agent on a device, it sets the ̽»¨´óÉñ Device Name (or display name) to match the hostname (or Windows Computer Name). This article explains how to change the hostname of a Windows device and update its corresponding Device Name in ̽»¨´óÉñ.
Considerations
- During initial agent installation, the ̽»¨´óÉñ Device Name matches the device's local hostname (Windows Computer Name).
- After initial installation, changes to the local hostname don't automatically update the Device Name in ̽»¨´óÉñ, and vice versa. To ensure they match, you must manually edit the Device Name in the Admin Portal or update it using PowerShell.
- Or you can use a ̽»¨´óÉñ Command to update a device's local hostname and the ̽»¨´óÉñ Device Name simultaneously.
Changing the Local Hostname Manually
To change the hostname on a Windows device:
- Go to Start > Settings.
- In the left menu, click System. Scroll down and click About.
- To the right of the hostname, click Rename this PC.
- Enter the desired new hostname and click Next.
- Follow the on-screen instructions, which may include a restart.
To change the hostname using command line:
- Open an administrative Command Prompt or PowerShell window.
- Enter the following command, replacing NEW-NAME with your desired hostname:
wmic computersystem where name="%COMPUTERNAME%" call rename name="NEW-NAME"
Allow up to 30 minutes for the ̽»¨´óÉñ Agent to update the device’s information to the newly changed hostname.
To verify the device's hostname in ̽»¨´óÉñ:
- Log in to the
- Go to DEVICE MANAGEMENT > Devices.
- Select the Devices tab.
- Locate the device in the list and select it.
- Go to the Insights tab and scroll down to Network to view the Hostname.
After changing the hostname locally, you must update the ̽»¨´óÉñ Device Name manually in the Admin Portal or using the PowerShell Module to ensure it matches the new hostname. Jump to Changing the Device Name Manually to Match the Hostname or Changing the Device Name Using PowerShell.
Changing the Device Name to Match the Hostname
After changing the hostname locally, you must manually update the Device Name in ̽»¨´óÉñ to match it. You can update it manually in the Admin Portal, or use the PowerShell Module covered in the following section.
To change the Device Name in ̽»¨´óÉñ:
- Log in to the
- Go to DEVICE MANAGEMENT > Devices.
- Select the Devices tab.
- Locate the device in the list and select it.
- In the top left, click the pencil next to the Device Name to edit.
- Enter the new Device Name based on the updated hostname.
- Click Done.
Changing the Device Name Using PowerShell
If you manually changed the local hostname on the device, use the following ̽»¨´óÉñ PowerShell command to update the Device Name in ̽»¨´óÉñ.
You'll need to have the PowerShell Module installed on your local device. See to learn more.
- Open PowerShell on your device and enter the following command:
Connect-JCOnline
- Enter your ̽»¨´óÉñ Administrator API Key to authenticate to your org via the API.
- Confirm the current hostname and displayName of the Windows device you're updating:
Get-JCSystem -hostname WINDOWS_HOSTNAME_GOES_HERE | select hostname, displayName
You'll see an output similar to the following:
hostname displayName
------------- -----------------
W11Han DESKTOP-TK421
- After verifying the hostname, enter the following command to change the displayName (̽»¨´óÉñ Device Name) to match the hostname:
Get-JCSystem -hostname WINDOWS_HOSTNAME_GOES_HERE | Set-JCSystem -displayName INSERT_HOST_NAME_HERE
You'll see an output similar to the following:
hostname displayName
------------- -----------------
W11Han W11Han
Using Commands to Change the Hostname and Device Name
You can also update a device's local hostname using ̽»¨´óÉñ Commands, which automatically updates the ̽»¨´óÉñ Device Name to match.
See Get Started: Commands to learn more about commands.
To create the Command in ̽»¨´óÉñ:
- Log in to the
- Go to DEVICE MANAGEMENT > Commands.
- Click ( + ), then choose Command From Template.
- In the Configure New Command from Template aside, go to the Windows tab.
- Search for the following command: Windows - Rename System HostName, LocalHostName and ComputerName from ̽»¨´óÉñ and then click configure.
- (Optional) Enter a custom name for the command (for example Rename Hostname for Windows).
- Under Command* find the API_KEY value and replace "YourReadOnlyAPIKey" with your API key.
- Go to the Devices tab to bind the command to a device, or the Device Groups tab to bind it to a group of devices.
- Click Save and then Run Now from the Commands page.
- Upon successful execution of the command, a device restart is recommended.