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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User credentials in a UNC path

Status
Not open for further replies.

pd123

Programmer
May 22, 2001
48
GB
Is it possible to pass login credentials into a UNC path?

eg.

\\server1\share\test.doc username/password

Many thanks,
pd123
 
You may do so in a command prompt.

Type NET USE /? for a list of the commands but it goes something like this:

NET USE J: \\SERVER\SHARE /user:domainname\username xxxxxx

The 'xxxxxx' is the password.

One thing you should be aware of, this will pass the username and password in clear text over the network and the password is visible (not masked), even if in a batch file.

If you omit the password, it will try a blank one. If it fails, it will prompt you for a password.

Beware that the blank password counts as a failed attempt. If you add this into a script or something, it could cause lockouts on the account you will be using, depending on the setting on your domain.



"In space, nobody can hear you click..."
 
Pass login credentials? You mean to avoid them?
Because once you are having an authorization from a domain controller, your accout will be recognize, and you wil be asked just for connections to shares on which you don't have yet authorization.
The credentials are part of a token that you will provide whenever you will try to access a resource.


Gia Betiu
gia@almondeyes.net
Computer Eng. CNE 4, CNE 5, MCSE Win2K
 
you can pass credentials through net use to map a drive/printer/etc. You can also do other thinks like "runas" to use pass credentials.
 
Thanks for your suggestions, I'll try the net use approach.

Regards,
pd123
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top