Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

914 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

15 Experts available now in Live!

Get 1:1 Help Now