I want to know how I can have the FULL adress of a user's "Desktop";
for example , for a user named "John", it can be like this:
C:\Documents and Settings\John\Desktop
How can I acquire the above string for the user who is logged in the windows.
thank you very much.
Answer Hi
Here is the code
<%
'''''''''''''''''''''''''''''''''''''''''''''''''
' ADSI User Authentication Script
' Peter A. Bromberg 01/26/2001
'''''''''''''''''''''''''''''''''''''''''''''''''
' Test here for a form post ...
if request("GETUSER") = "" Then
' write out the test form
With Response
.write "<FORM ACTION=USER.ASP METHOD=POST>"
.Write "<INPUT TYPE=TEXT NAME=oDomain>ENTER DOMAIN<BR>"
.write "<INPUT TYPE=TEXT NAME=oUSer>ENTER USER NAME TO CHECK<BR>"
.write "<INPUT TYPE=PASSWORD NAME=oPassword>ENTER USER PASSWORD<BR>"
.Write "<INPUT TYPE =SUBMIT NAME=GETUSER VALUE=CHECK>"
.write "</FORM>"
end with
else
' Form was autopostback, grab the form variables ...
oDomain= Request("oDomain")
oUser = Request("oUser")
oPassword = Request("oPassword")
' begin "Kludge" VBScript error trapping (see Javascript version for
try / catch handling)
on error resume next
' Set reference to the ADSI interface to NT User Manager ...
Set objUser = GetObject("WinNT://" & oDomain & "/" & oUser )
if err.number <> 0 then
Response.write "Login Error---"
Response.end
end if
If len(objUser.FullName) < 1 then
response.write "User Not Found!!!!"
response.end
else
on error resume next
' We verify the user password by using the ChangePassword method to change
' the password back to itself.
' Since this requires that first parameter password be correct, it's an easy' way to circumvent the fact
' that NT won't give actual access to the user's password to make a comparison. ' Be aware that on some systems,
' Admin policy settings may force the password
' to have to be changed after X number of uses
' of this method...
objUser.ChangePassword oPassword, oPassword
if err.number <> 0 then
Response.write" BAD PASSWORD!"
Response.end
else
' Now write out the ADSI User object properties that are supported by Windows 2000 ...