Skip to content

Get Username

July 1, 2008

One of the things we find handy is the ability to know who is logged on to a given computer at any one time. The main reason is that our users rarely tell us which computer they are on when they submit a help-request, so if we have someplace to look that makes our jobs that much easier.

The Getuser function returns the name of the currently logged on user, or the word "FREE" if nobody is logged on. I use this in conjunction with another function that updates the Active Directory description property of the computer object.

This function accepts one parameter:

  • strComputer

strComputer

This string variable is usually passed from a calling routine. That routine may be working through a .csv file or it may be pulling this data direct from Active Directory.

Advertisements

From → Scripting

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: