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!

IS there a way to define a user directory via a net use?

Status
Not open for further replies.

Y2KGTP

Technical User
Feb 13, 2004
44
US
Is there a easy way to define a user directory based on the User's ID via a net use, for several users?

Such as a net use to \\server\x share would redirect to a specific folder based on the User ID making the net use request? (Non AD users)
 
That sounds about right....just was looking for a way to redirect a new use on the server side based on the ID of the login user to a user folder.

such as if the ID of the user is TEST and the user does a net use to \\server\x it would redirect to the TEST folder on the server.

If another user TEST2 does a net use to \\server\x (same net use) it would redirect to a TEST2 folder....
 
I was looking to set up "home folders" for users to net use to, and store some documents off of their laptops so they will get backed up on a daily basis....
 
you have an AD domain, laptop users, the need to let them map drives on the AD server,

okies,

what os are the laptops running?

fred
 
No AD. Laptops running 2K, server running 2K.
 
ahh yes, the ole workgroup model.


I think this is your answer

you can put a vbscript in their "startup" program group that will silently map the drive for them. you can map to a folder within a share with windows 2000. what that means is you can have
{vbscript for net use} \\server\share\folderx
where "folderx" is the variable for the %username%

that way, the users only sees his folder, and you don't have to have a million shares configured on your server.

just have to set the permissions correctly on the server

a vbscript snippet shouldn't be that hard to find

Fred

 
ok, I got a snippet for you

Set objNetwork = Wscript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "G:", "\\atl-fs-01\Sales"
objNetwork.MapNetworkDrive "H:", "\\atl-fs-01\Users$\lewjudy"

 
here's the actual code that I plagerized(sp?)

dim strUserName
Set wshShell = WScript.CreateObject("WScript.Shell")
Set objNetwork = Wscript.CreateObject("WScript.Network")
strUserName = WshShell.ExpandEnvironmentStrings("%USERNAME%")
objNetwork.MapNetworkDrive "x:", "\\server\homedir\" & strUserName


you might want to start off with a
On Error Resume Next

at the top of the script once you are confident that the script will work for you

this will prevent the users from seeing the error that the network path is not found when they boot up "off the network"

this way, you can have one share, with many folders inside. the users won't see the other folders. you will have to set permissions on the folders inside though..

Fred
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top