I was recently asked “How can I start tracking user logins without modifying Active Directory or writing to a database?” Odd question right? Our reader, let’s call him Jose, had a few issues:
- He wasn’t allowed to modify Active Directory.
- He wasn’t allowed to set up any new servers/hardware/etc. This ruled out writing his computer logins to a database.
- He was allowed to edit Group Policy at his location. He did not have many restrictions there.
To me, it seems like his boss has their priorities a little mixed up – but oh well. Before finding out these restrictions, I referred him to these two articles:
I was hoping that the powers that could modify AD in his company would see the benefits of the solutions above. It turns out that they don’t trust this site… (or Microsoft documentation for that matter).
After a few emails back and forth, I found out what was going on and we came up with a manual hack to speeding up the whole “what computer are you on?” routine that every one of us face. We ended up using an old time tool with a modern deployment method.
With one registry change plus a deployment with Group Policy Preferences, we can stick the Computer Name under the start menu. Instead of a shortcut to Computer (or My Computer), the user sees “Computer: COMPUTERNAME”. This allows you to quickly check a computer name or to easily tell an employee how to find the computer name.
The Registry Key
Where do you suppose the registry hack to change the computer name shortcut would be located? The Classes Root Hive? The Local Machine Hive? No – It is illogically placed in the Current User Hive. Specifically, it can be found here:
HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}.
The default value is normally blank or set to Computer (My Computer). Because the Current User Hive can make use of variables like %COMPUTERNAME%, we can modify this key. Specifically, we can change the Default value from (value not set) and set it to Computer: %COMPUTERNAME%
The Group Policy Preference
In your staff GPO or in a new GPO that applies to your users, create a new Registry Preferences and leave the action at Update. Use the screenshot below to configure your registry preference:
After linking and applying the policy, log a user out and back in. You should see their Computer shortcut change to reflect their computer name! It should look something like the picture below. Pretty cool right?
One Final Tip
If you have Outlook 2013, you have an automated call (email?) center built in to your email client! Quick Steps allow you to type pre-written automated replies to common questions/steps. For example, I have a prewritten reply that explains how to find the computer name and how to submit a technology request.
For those teachers needing a little more instruction, I will also attach a How-To PowerPoint guide. That guide is below; feel free to change it/use it/etc.
PowerPoint Guide to Get the Computer Name
If you don’t have Office 2013, you can essentially make a quick step by typing up an email and saving it as a draft. Then just copy the draft for the new message. How do you get computer names for problems? What tips would you like to share? Leave a comment below and help a fellow tech out! 🙂
doesn’t work on win7 64-bit enterprise.
Startmenu only shows %COMPUTERNAME%
Changed the “Default” (which was empty) to %COMPUTERNAME%
(On cmd.exe %COMPUTERNAME% shows the hostname)
Mine wouldn’t either, but I found an alternative.
The key I found is located in HKCR which should mean it applies to all users on the pc, though I have not had a chance to test with another user yet.
{All Quotation Marks shown below are to be omitted when entering values}
1. Open Registry Editor and drill down to HKEY_CLASSES_ROOT\CLSID\
{20D04FE0-3AEA-1069-A2D8-08002B30309D}
2. Rename the “LocalizedString” value to “LocalizedString.BAK” in order to preserve a copy of the original should you ever want to revert. (TIP: You may need to take ownership of the key and give yourself full control if you get an error.)
3. Create a new Expandable String Value named “Localized String”
4. Set the value to “Computer: %Computername%” or anything else you’d like.
5. Log off and back on to verify change was successful.
Good Luck and Enjoy the fruits of your labor!
Thanks for the how-to!
Good thoughts jt – thanks for sharing!
For voice communications:
1. Their computer is labeled in our environments, they just have to look. 🙂
2. Windows-Pause/Break key combo shows System Properties that also contains the computer name.
3. You could create a batch file on the local PCs through Group Policy, place a shortcut on their desktop called “WHAT IS MY COMPUTER NAME?”. The batch file could use one of the methods below to get the information and display it to the user. (If .bat files aren’t allowed, convert it using bat2exe.)
Start | Program | Accessories | Command Prompt and enter “hostname”
Alternatively, Start | Program | Accessories | Command Prompt and enter “set”. The result will be under the COMPUTERNAME variable, as well as other information you can use.
Ticketeting Web Page:
1. If you have an internal web page (you can have a web server on your PC users access for tickets, or just the code he neads and reference it via iFrame on the main intranet ticket capture page)
Get the IP address of the client from the browser using javascript then perform a reverse DNS lookup to get the hostname. Assuming DNS infrastructure is setup correctly, this should yield the hostname with no effort on the part of the end user. (other than actually following procedure to open a ticket through the website)
Log method:
Create a group policy entry for startup script (and optionally a logoff script) that appends to a text file in an admin$ share (on a server or Jose’s PC) with the “LOGON” text + COMPUTERNAME, USERNAME, and DATE. You can then use this handy reference whenever is needed by searching from the bottom. Works great in onsite environments, not so well with remote users that don’t have DirectAccess or hardware VPN.
Each has advantages and disadvantages, perhaps a combination is best.
Very nice comment JT! I have never even thought of the reverse DNS lookup method! Great idea.
Did you see Part 1 and 2 of this series that showed the AD logging aspect?