Net Use On Windows PE

Lately, I’ve been working on Windows PE images, in one occasion I came across a persistent problem where I could not connect to a remote share on a Windows Server 2003 with the net use command no matter what I did. I knew the Server was not the problem because I could connect from my Windows 7 workstation. Despite proving the correct username and password I would receive the error below.

The user context supplied is invalid.

It proved to be stressful for a while which is why I decided to once again read the Product Documentation for Net Use. After adding some extra parameters to the Net Use command I was able to establish a connection with the Server.

Example:

net use * ipaddressshare /u:ipaddressusername password

Actual Example:

net use * 192.168.1.10Pshare /u:192.168.1.10Luis 5buckcoffe

Basically I had to specify the username and password instead being prompted by one which is when the error occurs. The share will connect right away and never prompt you for a username or password.