Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2008-06-13
4
510 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

856 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