Jump to content

How to use adfunctions.au3 script


GRCM
 Share

Recommended Posts

@GRCM

This does not use the adfunctions.au3, but it check the user in group anyhow.

Dim $InGroup

$oMyError = ObjEvent("AutoIt.Error", "ComError")


If  UserInGroup(@LogonDomain,@UserName,"YourGroup") then
    msgbox(0,"Validate",@LogonDomain &"/"&@UserName&" : User in your groupname " & $InGroup)
Else
    msgbox(0,"Validate",@LogonDomain &"/"&@UserName&" : User NOT in your groupname")
EndIf

Exit
; Check if User is in a group 
Func UserInGroup($Domain, $UserName, $InGroup)
    ;local $sRet
    Local $objUser = ObjGet("WinNT://" & $Domain & "/" & $UserName)
    
    For $oGroup in $objUser.Groups
        If $oGroup.Name = $InGroup Then  Return 1
    Next
    Return 0
EndFunc 

;COM Error function

regards

ptrex
Func ComError()
    If IsObj($oMyError) Then
        $HexNumber = Hex($oMyError.number, 8)
        SetError($HexNumber)
    Else
        SetError(1)
    EndIf
    Return 0
EndFunc ;==>ComError
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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