wantabe2
asked on
Login Script Drive Mapping Issue
I have the following code in my login script:
It is supposed to map drive G: but I am prompted for a username & password if I run the script manually. How can I embed the username & password for to access this drive inside the code I have listed above?
If (IsMember(objUser, "Office Users") = True) Then
On Error Resume Next
objNetwork.MapNetworkDrive "g:", "\\165.123.32.3\share"
If (Err.Number <> 0) Then
On Error GoTo 0
objNetwork.RemoveNetworkDrive "g:", True, True
objNetwork.MapNetworkDrive "g:", "\\165.123.32.3\share"
End If
On Error GoTo 0
End If
It is supposed to map drive G: but I am prompted for a username & password if I run the script manually. How can I embed the username & password for to access this drive inside the code I have listed above?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
but cant you add office to \\165.123.32.3\share permissions ?
ASKER
So it would look like this? I can't test it at this time but will in about 2 or 3 hours...
If (IsMember(objUser, "Office Users") = True) Then
On Error Resume Next
objNetwork.MapNetworkDrive "g:", "\\165.123.32.3\share"
If (Err.Number <> 0) Then
On Error GoTo 0
objNetwork.RemoveNetworkDrive "g:", True, True
objNetwork.MapNetworkDrive "g:", "\\165.123.32.3\share"
strUser = theusername
strPassword = thepassword
End If
On Error GoTo 0
End If
yes but I said why does it require the user and password in the script it suggests that the office permissions are not on the share