A common task any Windows admin might have is finding out, locally or remotely, which user account is logged onto a particular computer.Many tools exist for this purpose, and one of them, of course, is Power Shell.We know this because the username starts with MYLAB, rather than MEMBERSRV1.

Description = new Description and not left(obj Computer. All that remains now is to add the VBScript to the user login script. Once your GPO is updated, restart another system, and login again – once more, you should see that computers AD object updated.

Now you can stil back and relax while you watch your computer objects in AD fill up with useful information in the description field.

In this article, I'm going to go over how to build a Power Shell script to find a logged-on user on your local Windows machine, as well as on many different remote Windows machines at once.

By the end, you should have a good understanding of what it takes to query the logged-on user of a Windows computer.

A Windows admin might need this information to create reports, to track down malware infection or to see who's in the office.

Since this is a repeatable task, it's a good idea to build a script that you can reuse over and over again, rather than having to figure out how to do it every time.Computer Name) ' Build up description field data and save into computer object if different from current description ' We also do not update computers with a description that starts with an underscore (_) new Description = Wsh Network.User Name & " (" & service Tag & " – " & manufacturer & " " & model & ")" if not obj Computer. Set Info end if If you run this script as a regular user, then check ADUC, you should find that the computer object that the script was run from, has now a description field set.The page provides information about officially released software only.Remember that CM07/CM12 is not a real time product and there is it will be best effort only. System Type0 as [System Type] from V_GS_NETWORK_LOGIN_PROFILE left JOIN v_GS_SYSTEM ON V_GS_NETWORK_LOGIN_PROFILE. It’s very rare to see an IT department that makes regular use of this field for something useful – never mind keeping it up to date!