HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 19th, 2001, 06:46 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
How Can I get User Information using ADSI

Originally posted by : sameers (sameers@theangrycoder.com)I want to get the User Info like user name and Computer Name of the User. I came to know that ADSI can Do this. I want to use it with ASPwith thanks sameerssameers@theangrycoder.com

Reply With Quote
  #2  
Old January 15th, 2002, 11:37 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Originally posted by : Vishvas (vishvas_kumar@yahoo.com)You can do something like this.Dim UserDim UserNameDim DomainDomain = "Domain_Name"UserName = "USER_NAME"Set User = GetObject("WinNT://" & Domain & "/" & UserName & ",user")Response.Write User.FullnameHope it helps.------------sameers at 10/19/2001 3:46:32 PMI want to get the User Info like user name and Computer Name of the User. I came to know that ADSI can Do this. I want to use it with ASPwith thanks sameerssameers@theangrycoder.com

Reply With Quote
  #3  
Old October 28th, 2003, 12:44 AM
bradyrj bradyrj is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 1 bradyrj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
'4.1 Display User Fullname


Sub PullUserFullname(strDomain,strUser)
Dim User
Set User = GetObject("WinNT://" & strDomain & "/" & strUser & ",user")
Response.write User.Fullname
End sub

'4.11 Display User Profile Path

Sub PullUserProfilePath(strDomain,strUser)
Dim User
Set User = GetObject("WinNT://" & strDomain & "/" & strUser & ",user")
Response.Write User.Profile
End Sub

'4.15 Display User Account Expiration Date (NT 4.0 only)

Sub PullUserAccountExpireDate(strDomain,strUser)
Dim User
Set User = GetObject("WinNT://" & strDomain & "/" & strUser & ",user")
Response.Write User.AccountExpirationDate
End Sub

'4.17 Display User Last Login (NT 4.0 only)

Sub PullUserLastLogin(strDomain,strUser)
Dim User
Set User = GetObject("WinNT://" & strDomain & "/" & strUser & ",user")
Response.Write User.LastLogin
End Sub

'4.18 Display User Last Logoff (NT 4.0 only)

Sub PullUserLastLogoff(strDomain,strUser)
Dim User
Set User = GetObject("WinNT://" & strDomain & "/" & strUser & ",user")
Response.Write User.LastLogoff
End Sub

'4.10 Display User Account Type

Sub PullUserAccountType(strDomain,strUser)
Dim User
Dim Flags

Set User = GetObject("WinNT://" & strDomain & "/" & strUser & ",user")
Flags = User.Get("UserFlags")
Response.write Flags And &H100 '// 0 Means that account is GLOBAL
End sub

'5.2 Display Which Group a User is Listed in

Sub DispUserInWhichGroup(strDomain,strGroup,strUser)
Dim Group
Dim User
Set User = GetObject("WinNT://" & strDomain & "/" & strUser & ",user")
For Each Group in User.Groups
Response.Write (Group.Name & "<br>")
Next
End Sub

Reply With Quote
  #4  
Old December 11th, 2003, 10:37 AM
ankurgupta26 ankurgupta26 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 1 ankurgupta26 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
This particular thread was pretty useful for getting user details from ADSI. Not very easy to find anything on ADSI on the Net.

Is there also a way to get the user's email address. I am sure there must be a way.

Reply With Quote
  #5  
Old June 17th, 2004, 02:03 AM
sinantrya sinantrya is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Indonesia
Posts: 4 sinantrya User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Querying user account from adsi

Hi,
I have some problem in accessing the Active Directory, i want to make some web based application that user can booking
the computer that connected in the active directory.

I need to know how to access Account in the user property, and get the user logon name & password.

Setting logon hours (what day and setting logon session by per-hours and determine which computer he/she can logon to
After the hours that he/she chose their session is automatically disconected)

It's all in the user-> property

Until now i only can get the list of the user and computer, and the script is like this (i'am using win2000)


' user.asp

<<A href="mailto:%@LANGUAGE="VBSCRIPT">%@LANGUAGE="VBSCRIPT" CODEPAGE="CP_ACP"%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<%
Dim Conn, strRS, RS, strConn
Set Conn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.Recordset")
Conn.Provider = "ADsDSOObject"
strConn = "Active Directory Provider"
Conn.Open strConn
strRS = "SELECT givenname FROM 'LDAP://DOMAIN_NAME' WHERE objectClass = 'user' ORDER by name "
RS.Open strRS, Conn,1,1

While RS.EOF = False
'f ("givenname"!=NULL)
Response.Write "Name:" &RS("givenname")& "<br>"
RS.MoveNext
'end if
Wend


%>
</body>
</html>


computers.asp

<<A href="mailto:%@LANGUAGE="VBSCRIPT">%@LANGUAGE="VBSCRIPT" CODEPAGE="CP_ACP"%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<%
Dim Conn, strRS, RS, strConn
Set Conn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.Recordset")
Conn.Provider = "ADsDSOObject"
strConn = "Active Directory Provider"
Conn.Open strConn
strRS = "SELECT name FROM 'LDAP://DOMAIN_NAME' WHERE objectClass = 'computer' ORDER by name "
RS.Open strRS, Conn,1,1

While RS.EOF = False
'f ("givenname"!=NULL)
Response.Write "Name:" &RS("name")& "<br>"
RS.MoveNext
'end if
Wend


%>
</body>
</html>


I just need to know how to get
-user name logon
-password
-logon hours
-logon onto
etc

from account

and also
-end a disconnected session
-active session limit
-idle session limit
etc

from session

Thank's

Reply With Quote
  #6  
Old July 30th, 2004, 03:39 AM
sinantrya sinantrya is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Indonesia
Posts: 4 sinantrya User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy

Thank's for the helps
But now i still confused about how to access the user log on and setting
the binary for logon permitted and logon denied from ASP
I've tried Query name like this but it's return error

select logonhours from 'LDAP://DOMAIN_NAME' WHERE objectClass = 'user'

also the user logon to
i want to add computer to the list of user logon to but it's also return error

The field name for Logon hours and logon to in LDAP are :


Logon hours: logonHours
Syntax : Binary
Description :Weekdays and hours in one-hour increments during which
the user is allowed to log on

Logon To : userWorkstation
Syntax : Text
Description : A list of computer NetBIOS names that the user is allowed to log on to.

--------------------------------------------------------------------------------

Does anyone have a book or file about ADSI programming with ASP??
please send me a file about that to
homer@inf.its-sby.edu

thank's
sinantrya

Reply With Quote
  #7  
Old October 30th, 2004, 09:57 PM
sinantrya sinantrya is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Indonesia
Posts: 4 sinantrya User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question ADSI LoginHours and Logon to

Sub PullUserLogonHourRestriction(strDomain,strUser)
Dim User
Dim RegTime
Dim Restrict

Set User = GetObject("WinNT://" & strDomain & "/" & strUser & ",user")
For Each RegTime In User.LoginHours
If RegTime < 255 Then Restrict = True
Next
Response.write Restrict
End Sub

I've tried the script up there, but it has an error that variable RegTime and User.loginHours does't have the same type or type mismatch
But i read that user.loginhors has binary type but i've tried to change the type of variable regtime to boolean but it have no effect

Thanks

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > How Can I get User Information using ADSI


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT