Solved

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

Posted on 2008-06-13
4
528 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
[X]
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
  • 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

690 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