I have been able to access UNC paths on a different domain in powershell with:
net use \\machine.domain.int\c$\ /user:domain\user $password
this allowed me to directly cd into \\machine.domain.int\c$
However I have now created a networked drive and I'm seemingly not able to do the same.
net use \\machine2.domain.int\Drive\ /user:domain\user $password
Results in success but I am unable to cd into the directory. However if I map the drive with
net use Y: \\machine2.domain.int\Drive\ /user:domain\user $password
I can access its contents from Y:\
but not from \\machine2.domain.int\Drive\
What can I do if I absolutely do not want to map the path to a drive?
edit: The machines in question are two separate machines that are on the same domain.
edit2: Same thing happens when creating a new PSDrive. Both succeed but when trying to enter the directory the second one errors with: Cannot find path 'path' because it does not exist
edit3:
I did a lot more digging and tried all the combinations I could think of
Works:
net use Y: \\machine2.domain.int\Drive /user:domain\user $password
net use \\machine2.domain.int\c$\Path /user:domain\user $password
New-PSDrive -Name "P" -PSProvider "FileSystem" -Root "\\machine2.domain.int\c$\Path"
Doesn't work:
net use \\machine2.domain.int\Drive /user:domain\user $password
net use \\machine2.domain.int\Drive\ /user:domain\user $password
New-PSDrive -Name "P" -PSProvider "FileSystem" -Root "\\machine2.domain.int\Drive"
New-PSDrive -Name "P" -PSProvider "FileSystem" -Root "\\machine2.domain.int\Drive" -Persist
(New error! new-psdrive : To use the Persist switch parameter, the drive name must be supported by the operating system (for example, drive letters A-Z).
)
Problems:
I can not use \\machine2.domain.int\c$\Path
because it requires an administrative account.
I absolutely do not want to make a permanent drive
It looks like one of the systems does not support using the \\machine2.domain.int\Builds
syntax (except with net use Y:), anyone got any clues on fixing this?