Jump to content

Recommended Posts

Posted

Hi, I'm having a little trouble grabbing a user name. I have a script currently that grabs OS, RAM, Hard Drive, etc for invenotry that runs as a startup script and saves to sql. Currently I grab the user name, which all of our employee numbers are there user name. Example: 16830 is the user name I'm getting. However, I want to get there actual Employee Name. In Active Directory, for each user, there Display name is their full name. In Windows, when I click start, it says log off "John Doe" so the Display name is being passed with each user name.

So, based on that. I need assistance obtaining the Display Name from Active Directory, based on the username of the currently logged in user. Thanks ahead of time for your help!

Posted

@UserName ?

8)

BTW.... Welcome to the Autoit Forums... 8)

I am using @username to grab the user name. Yes that is working. User name is returning as 16830, which is the employee #. But I also want to grab their FULL NAME which is the Display Name in Active Directory.

Posted

Yes I did try that. And I used this usage of it:

dsquery user -samid %username%

and it returns what I'm looking for.

So now, I just have to have that command run within AutoIt, any help with running that dos command in autoit daram??

Posted

Yes I did try that. And I used this usage of it:

dsquery user -samid %username%

and it returns what I'm looking for.

So now, I just have to have that command run within AutoIt, any help with running that dos command in autoit daram??

Run or ShellExecute, mayhap? I dont quite know much more to suggest myself.

Luckily there are much smarter people than me hanging around here. :D

Posted

Run or ShellExecute, mayhap? I dont quite know much more to suggest myself.

Luckily there are much smarter people than me hanging around here. :D

Tried that. And I keep getting an error saying error in dsquery. Missing entry:user.

The same command runs fine from command line, but when using shellexecute i get this error. HELP! Need o get this done today. Thanks guys!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...