Getting Access is denied while using NET view command

8

4

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?

AMIT

Posted 2011-02-11T11:12:13.863

Reputation: 499

Answers

10

This worked for me:

net use \\server\IPC$

net view \\server

Once 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.)

user1686

Posted 2011-02-11T11:12:13.863

Reputation: 283 655

Thanks @Grawity only one doubt i wanna to clear is like am trying to share Linux machine folder on windows machine ,username and password is of windows machines or of Linux's machine user name and password – AMIT – 2011-02-12T21:47:49.947

@AMIT: Of the machine you are connecting to. – user1686 – 2011-02-12T22:17:51.967

did you remove how to create credentials on windows?? – AMIT – 2011-02-14T06:11:17.977

@AMIT: Yes. Want it back? (Also try net use ... /savecred) – user1686 – 2011-02-14T09:12:51.590

5

You cannot do this for the net view command, only for net use:

net use \\server\share /user:AMIT

However, 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.

    Adding a server

  • In Windows 7, Control Panel → User Accounts → Manage credentials. Click Add a Windows credential.

user1686

Posted 2011-02-11T11:12:13.863

Reputation: 283 655

THANKS @Grawity for your response but i don't folder is shared on server , and i want to use net view command to see which folder is shared now am getting permission denied ,then how do i see the shared folder on server – AMIT – 2011-02-12T14:40:21.213

@AMIT: Tell Windows your password as described in the second part of my answer. Then try net view. – user1686 – 2011-02-12T15:50:15.490

@AMIT: See my second answer for a different method I just remembered. – user1686 – 2011-02-12T16:07:05.190

still getting System error 5 has occurred. Access is denied. – AMIT – 2011-02-15T06:39:08.377

is it sumthing am missing in samba conf file?? – AMIT – 2011-02-15T06:40:49.000

3

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$ /delete

Microsoft has disabled anonymous login in Windows Server. It can be re-enabled using GPO, but this is regarded a security risk.

Klaus Hartnegg

Posted 2011-02-11T11:12:13.863

Reputation: 51

You the real MVP – HackSlash – 2019-03-22T20:34:33.233

0

I 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.

TechSand

Posted 2011-02-11T11:12:13.863

Reputation: 1

Please clarify and add a little more context to this answer to convey what you are suggesting exactly. You know, consider adding some reference to this answer supporting what you state. Otherwise, read over "Why do I need 50 reputation to comment" to ensure you understand how you can start commenting.

– Pimp Juice IT – 2017-08-23T00:12:36.463