Sign in to follow this  
Followers 0
fcjoe

VBScript to AutoIT using AND

3 posts in this topic

Function IsAccountDisabled(intUAC)
    Const ADS_UF_ACCOUNTDISABLE = 2
    If intUAC And ADS_UF_ACCOUNTDISABLE Then
        IsAccountDisabled = True
    Else
        IsAccountDisabled = False
    End If
End Function

I have a VBScript that I'm converting to AutoIT. What it does is query Active Directory for all accounts and doesn't count the ones that are disabled. The function in VBScript to to determine if it is disabled is below

' Function to perform an AND comparison against the AD field UserAccountControl to determine if the account is disabled

Function IsAccountDisabled(intUAC)

Const ADS_UF_ACCOUNTDISABLE = 2

If intUAC And ADS_UF_ACCOUNTDISABLE Then

IsAccountDisabled = True

Else

IsAccountDisabled = False

End If

End Function

It will return True is the account is disabled. However, VBScript and Autoit treet 'AND' differently. Does anyone know how to get this to work in AutoIt?

Thank you,

Joe

Share this post


Link to post
Share on other sites



BitAnd($intUAC, $ADS_UF_ACCOUNTDISABLE)

Share this post


Link to post
Share on other sites

That was simple, I feel stupid.

Thank you,

Joe

BitAnd($intUAC, $ADS_UF_ACCOUNTDISABLE)

Share this post


Link to post
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
Sign in to follow this  
Followers 0