Solved

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

Posted on 2008-06-13
4
479 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Yeah, that link has the hex/decimal values for all of the flags inside the userAccountControl property
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now