Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Network Drive

Status
Not open for further replies.

caconner

Technical User
May 20, 2002
42
US
I'm struggling to load an intranet page based on the user logon. I tried unsuccessfully to get the info from ServerVariables, but didn't want the user to have to log into IIS after they've already logged onto the Novell network. My second option was to retrieve the user name from the I: drive, which we have mapped as a POBox with the person's name - ServerName\vol1\homes\UserName.

Currently I'm totally hosed up just trying to access the I: drive, let alone any subfolder. The C: drive is no problem, but if I change it to any other drive I get a Microsoft VBScript runtime error '800a0044' - Device unavailable error. Any suggestions to the code below would be tremendously appreciated!

<%
dim fs, d, n
set fs=Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
set d=fs.GetDrive(&quot;I:&quot;)
Response.Write(&quot;The drive letter is: &quot; & d.driveletter)
set d=nothing
set fs=nothing
%>
 
Do you want to know THE USER's Logon name? like Administrator, User, etc .
I think This sample would be useful for you

Declare Function GetUserName& Lib &quot;advapi32.dll&quot; Alias &quot;GetUserNameA&quot; (ByVal _
lpBuffer As String, nSize As Long)

specify nsize as a higher number than the max length of the user name, somthing like this:

Dim s$, cnt&, dl&
cnt& = 199
s$ = String$(2ØØ, Ø)
dl& = GetUserName(s$, cnt)
msgbox s$

Let me know if that works...

Juanjo

Follow the dark side, so you can reach the light.
 
I'm defintely a novice in this particular department. I declared the function and copied the code to the body of the script, but couldn't get it to work. I kept receiving error messages on all the special characters, and now continue to get one on the function declaration.

<%
Function GetUserName Lib &quot;advapi32.dll&quot; Alias &quot;GetUserNameA&quot; (ByVal _
lpBuffer As String, nSize As Long)

Dim s, cnt, dl
cnt = 199
s = String(200, 0)
dl = GetUserName(s, cnt)
msgbox s
%>

I tried using LOGON_USER as well, but the variable always comes up empty. It seems like it should be an easy task, but have been struggling with it for much longer than seems neccsary.

Any other suggestions may save my sanity. TIA
 
Try to use Request.ServerVariables to help you

<%
response.write Request.ServerVariables(&quot;AUTH_NAME&quot;)
response.write Request.ServerVariables(&quot;LOGON_USER&quot;)
response.write Request.ServerVariables(&quot;REMOTE_USER&quot;)
%>


You can see all the ServerVariables using the follow code, see if there is anything you might need:

<%
for each item in Request.ServerVariables
response.write item & &quot;=&quot; & Request.ServerVariables(item) & &quot;<BR>&quot;
next
%>

If you have a problem getting blanks in AUTH_NAME, LOGON_USER... please check this:

Cheers... you only have to modify the IIS service
Juanjo


Follow the dark side, so you can reach the light.
 
I did try to use ServerVariables, but they consistently came back blank. I may have it figured out using Windows Srcipt Host, though.

Thanks for the help and the link! I've been looking for something that expians IIS Authentication, since I knew that had to be why those variables were blank.

Cathleen
 
Good to know!!

Juanjo

Follow the dark side, so you can reach the light. [/color}
 
another item that might be of use is authentix ( used by most pay web sites for security ) which operates as a com component, that when the user logs in you can capture the log in information and use that in page to feed the novell and session and database environments per user


hope it's of help
 
Remember that if you're trying to catch data off the I: drive of the client PC (which I suspect you are to find out whos logged in) then you can't do that with the FSO, as it runs on the server. Not helpful in itself, but explains why your getting the Device unavailable error.

-Geeeeeeeeeeeeeeeeeeeeeeee-
-=
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top