Jump to content

Recommended Posts

Posted (edited)

I finally got round to porting the MemberOf function in Larry's old Au3Xtra.dll to the new AU3 plugin format. In the process, I have renamed it to InGroup, swapped the params around and made the username param optional.

Usage is as follows:

InGroup("groupname")

or

InGroup("groupname", "username")

Returns 1 if user is in group, otherwise 0

If username is omitted then the current username is used.

InGroup searches local groups first, then domain groups. You can prefix a group name with domain name, i.e DOMAIN\Group, to skip the local search.

P.S You need the latest beta.

InGroup.dll

InGroup_src.zip

Edited by SumTingWong
Posted (edited)

I get ERROR: InGroup(): undefined function

I am using 3.1.1.85

This is how you should be calling it:

$handle = PluginOpen(@ScriptDir & "\InGroup.dll")
; user administrator in local group Administrators?
ConsoleWrite(InGroup("Administrators", "administrator") & @LF)
; user SumTingWong in domain group Domain Users?
ConsoleWrite(InGroup("Domain Users", "SumTingWong") & @LF)
PluginClose($handle)

If you are using Scite, just skip the syntax check error.

Edited by SumTingWong

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...