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鈥檚 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.