http://www.perlmonks.org?node_id=305174


in reply to Still wont work :(
in thread Win32::Lanman::NetUserEnum ... FLAGS

Are you sure that the account is disabled?

From the sounds of it you might not know what I meant by "and"ing. In case you're a little confused about that, here's how it works.

That number you see isn't used as a decimal number as you typed it. It's actually used as a binary number. Each binary digit is used as either ON(1) or OFF(0). Now each of those binary places can also be represented as a decimal number.

00000001=1
00000010=2
00000100=4
00001000=8
00010000=16
00100000=32
etc..

So... all of these numbers are represented as the UF_ constants. When you AND, you're checking if the bit represented in the UF_ variable is on.

If, for the account you're checking, the account is disabled, I'm guessing you have a problem someplace else.

Your other option is to use WMI. You can invoke it using Win32::OLE . Google for Win32_UserAccount and you should find some good information.

Replies are listed 'Best First'.
Re: Re: Still wont work :(
by Anonymous Monk on Nov 07, 2003 at 00:27 UTC
    I should have elaborated a bit more. I did try running the code against both enabled and disabled with same result. Different flags value tho.

    I knew what you meant by 'Anding' the bits. Same as figuring out a subnet... I even thought about converting the number to binary and figuring out the switch values with a pencil. :)

    Now for the very embarrasing truth of the matter...

    use Win32::Lanman != use Win32::lanman

    Change that detail and it all works like a charm.

    Apreciate the help and thanks to BrowserUK as well!!

    -David