Jump to content

Recommended Posts

Posted (edited)

Can someone help me with this?

 

I used this code, but unfortunately when the message prompt, it's doesn't return any value. I tried change the @LogonDomain to my localhost name or just localhost, but not work.

 

$oMyError = ObjEvent("AutoIt.Error", "ComError")
$UserObj = ObjGet("WinNT://" & @LogonDomain & "/" & @UserName)
If @error Then
    MsgBox(0, 'username', 'Error connecting to domain')
Else
    MsgBox(0, 'username', $UserObj.FullName)
EndIf
$UserObj = ""
$oMyError = ObjEvent("AutoIt.Error", "")
;COM Error function
Func ComError()
    If IsObj($oMyError) Then
        $HexNumber = Hex($oMyError.number, 8)
        SetError($HexNumber)
    Else
        SetError(1)
    EndIf
    Return 0
EndFunc  ;==>ComError

lRK4c8.jpg

Edited by Queener

Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")
Posted

@Queener, AutoIt built-in macros @LogonDomain and @UserName contain that information, so what exactly are you looking for?

Signature - my forum contributions:

  Reveal hidden contents

 

Posted

@Username populate the login name and not the full name in AD.

Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")
Posted

if the computer @LogonDomain is not identical to the user domain in AD, then use the Active Directory UDF - it has just the function you need.

Signature - my forum contributions:

  Reveal hidden contents

 

Posted

Function _AD_GetObjectAttribute should return the required information.
Run example script _AD_GetObjectProperties.au3 to get a list of available properties.

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

sounds good, will give it a try and keep you guys in the loop.

Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...