473,749 Members | 2,402 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DirectoryEntry without using admin user: how to check if account'sexpire d

Hello,
Programming in VS2003-ASP.NET 1.1, I have this problem: Using
DirectoryEntry and without any admin user, how can I check if a domain
account, that try to login, has expired?
Scenario: User load web application and login using account and
password of the Active Directory.
But user account of ActiveDirectory has expired (or password could be
expired). For security reason, we don't want to use any account with
admin privilegies for connecting through AD. So if user account "jdoe"
with password:"jdoe_ password" try to login, how to determine if
account has expired.
Code:

Dim Domain As String = "DOMAINXXX"
Dim sUserName="jdoe ": Dim sPassword="jdoe _password"
Dim myEntry As System.Director yServices.Direc toryEntry =
New System.Director yServices.Direc toryEntry("LDAP ://" & Domain,
sUserName, sPassword,
System.Director yServices.Authe nticationTypes. Secure)
myEntry.Usernam e = sUserName
myEntry.Passwor d = sPassword

Dim mySearcher As
System.Director yServices.Direc torySearcher = New
System.Director yServices.Direc torySearcher(my Entry)
Dim myResult As System.Director yServices.Searc hResult

mySearcher.Filt er = "(&(objectCateg ory=person)
(objectClass=us er)(userPrincip alName=" & UserName & "*))"

Dim x as String = myResult.Proper ties("sAMAccoun tName")(0) ''<-- it
gets 'jdoe'
Dim y as String = myResult.Proper ties("userAccou ntControl")(0) ''<--
it gets Nothing

I don't think it's impossible, or that you have to use an admin user
to get that (if you have to use an admin user for connecting to AD,
what about security?)
Thanks
Aug 14 '08 #1
0 1605

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3531
by: chris_fieldhouse | last post by:
Hi fairly new to php, but picking it up quite well. the question I have, is it possible for a php script which is used to validate values submitted in a form, to then post these values onto another script/page or even back to the calling form? i.e. the application I have in question is a login.htm page with a verify.php script The login.htm has a Form which captures login_id and password which are posted to verify.php
1
1244
by: sam | last post by:
Hi, I know fragment caching where you can use a cached user control in a non-cached page (or the opposite) But without using a user control, how can I cache just a part of my page (two datatables) but not the rest of the page ?
2
1170
by: rodwilnot | last post by:
This is a very basic question. I've searched around a bunch on groups, the web, etc., and found tons of information but nothing that specifically answers my question. My suspicion is that I am so clueless that I'm looking at the answer but not even realizing it, so bear with me. I want to override some of the default behavior for ASP.NET controls. Can this be done purely in class library code, i.e., without using a Web User Control?
0
1144
by: nemo | last post by:
Hi, I'm able to create, debug, and run ASP.Net projects when I login as a user with admin privileges. However if I logon to the same machine as a user without admin privileges, I get the following message when I try to debug an ASP.Net application: "Error while trying to run project: Unable to start debugging on the web server. Access is denied. Click Help for more information."
2
1822
by: kinnu | last post by:
Hi, I want to run a EXE file in startup in all user logins. I dont have admin rights. But the exe file should excute for all the users and in the registry HKEY_CURRENT_USER is the only key i can edit. Pls help... Thankz....
0
1463
by: Rahul Babbar | last post by:
Hi, I have two users, both of which are part of db2grp1, which is the admin user. db2grp1 has atleast 2 users, user1 and user2. I create a table in user2, name it table2. When i try to delete the contents of that table through user1, it does delete. I tried various ways like "Revoke Delete on user2.table2 from user1"
2
3324
by: gangac | last post by:
I am currently working on an ms access application for a large insurance company which generates reports for the user after the user inputs/select some data.... Unfortunately the application has already been built - and till now we used to run the application/reports by logging in as admin.. however, we now want that users login to the database as a 'user' with limited privileges- but the vba code, which is locked to run with privileges...
2
2814
by: Scott | last post by:
Attempting to install WCF service on stand alone 2003 server as a admin user (not administrator but user "WCF" i.e user added to local admin group). It fails with user error: The description for Event ID ( 11001 ) in Source ( MsiInstaller ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to...
1
1513
by: Babu1983 | last post by:
Hi I had accidentally deleted the sole Admin user for my db. ie. My db had a single admin user 'kanagab'. somehow, I had deleted the user 'kanagab' (Tools->Security->User and Group Accounts->select'kanagab' from the drop down and click 'Delete' button) There is no other user belonging to 'Admins' group This means, I was able to delete an user belonging to 'Admins' group (kanagab) when I had logged in with the same user id (kanagab)
0
9389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8257
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6079
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4709
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3320
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2218
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.