I'm trying to map a network drive to my machine and I'm using net view \computename but I'm getting the "Access is denied" message.
How do I provide the username and password to the net view command without using domain and this username? Should I use my computername's username and password or my machine username and password?
4 Answers
This worked for me:
net use \\server\IPC$
net view \\serverOnce you connect to IPC$ (or any share, in fact), Windows will reuse the same credentials (or even the same TCP connection) for all other operations.
(IPC$ is a system share that exists on all CIFS/SMB servers, therefore it's guaranteed to work.)
You cannot do this for the net view command, only for net use:
net use \\server\share /user:AMITHowever, you can add the username/password to Windows' Credential store. This will make Windows use that password for all connections to your specified server, whether you make them with net view, net use, or Windows Explorer.
In Windows XP, open Control Panel → User Accounts → Manage my network passwords (alternatively, Start → Run →
rundll32 Shell32.dll,Control_RunDLL keymgr.dll). Click Add.In Windows 7, Control Panel → User Accounts → Manage credentials. Click Add a Windows credential.
Username and password are often not needed for net view, especially if the server is running Samba. You can then connect anonymously to the IPC$ share by specifying empty username and password, then the net view command will work. For example I have put this into a script smbview.cmd
@echo off
net use \\%1\IPC$ /u:"" "" /persistent:no
net view \\%1
net use \\%1\IPC$ /deleteMicrosoft has disabled anonymous login in Windows Server. It can be re-enabled using GPO, but this is regarded a security risk.
1I know this has been resolved; however I did want to add that others that are having similar issues may have cached credentials in the credential manager that are incorrect. A simple solution would be to delete any credentials found in the manager related to the issues and reissue or not use credentials depending on the architecture.
1