Solved

Anyone know the Workstation attribute in Active Directory to find a Disabled workstation?

Posted on 2008-06-13
4
516 Views
Last Modified: 2012-06-22
I have the following Active Directory DirectoryEntry routine below.  I don't need the "userAccountControl" property but I really need a Workstation Property that shows whether or not it is disabled.
I've used ADSI Edit tool but don't see anything that resembles this.
Many thanks to whomever could help!!
WD
Imports System.directoryservices
 
        Dim de As DirectoryEntry
 
        de = New DirectoryEntry("LDAP://" & objRecordSet.Fields("distinguishedName").Value.ToString)
        if CBool(Cint(de.Properties("userAccountControl").Value) And &H2) then

Open in new window

0
Comment
Question by:wally_davis
  • 2
  • 2
4 Comments
 
LVL 41

Accepted Solution

by:
graye earned 500 total points
ID: 21793328
The "AccountDisabled" property is now just a flag inside the userAccountControl.   So, to see if an account is disabled, you'd retrieve the userAccountControl and test whether the AccountDisabled flag is present (the &h2 in the example above)

http://support.microsoft.com/kb/305144
0
 

Author Comment

by:wally_davis
ID: 21794568
Graye,
I would think this property is for the User Account specifically. Will this also work for a "Workstation"Account? I'm running a routine that looks at AD to see if that account is disabled. Thanks
0
 

Author Comment

by:wally_davis
ID: 21794595
Sorry Graye, I think I finally got what your saying. So, if I use ADSI, whether it's a User or a Workstation Account, I should see the value, "4096" to indicate the account is disabled. Is there some information out there that breaks down the &H1, &H2, etc. information so I know which one to use when I need it??
0
 
LVL 41

Expert Comment

by:graye
ID: 21795052
Yeah, that link has the hex/decimal values for all of the flags inside the userAccountControl property
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question