Дано:

  1. Две машины - Алиса (мой компьютер) и Боб (сервер)
  2. Общий файл на Алисе

Общий файл доступен из bob:

PS D:\temp> echo $env:COMPUTERNAME
bob
PS D:\temp> dir \\alice\users\mkharitonov\1.txt


    Directory: \\alice\users\mkharitonov


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        3/20/2018  12:46 PM            558 1.txt


PS D:\temp> echo $env:USERNAME
mkharitonov
PS D:\temp> echo $env:USERDOMAIN
xyz
PS D:\temp>

Но нет, если я пытаюсь сделать это из удаленного сеанса Powershell, открытого для Боба от Алисы:

PS E:\utils> echo $env:COMPUTERNAME
alice
PS E:\utils> Enter-PSSession -ComputerName bob
[bob]: PS C:\Users\mkharitonov\Documents> Test-WsMan alice


wsmid           : http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd
ProtocolVersion : http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd
ProductVendor   : Microsoft Corporation
ProductVersion  : OS: 0.0.0 SP: 0.0 Stack: 3.0



[bob]: PS C:\Users\mkharitonov\Documents> dir \\alice\users\mkharitonov\1.txt
dir : Access is denied
    + CategoryInfo          : PermissionDenied: (\\alice\users\mkharitonov\1.txt:String) [Get-ChildItem], UnauthorizedAccessException
    + FullyQualifiedErrorId : ItemExistsUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand

dir : Cannot find path '\\alice\users\mkharitonov\1.txt' because it does not exist.
    + CategoryInfo          : ObjectNotFound: (\\alice\users\mkharitonov\1.txt:String) [Get-ChildItem], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

[bob]: PS C:\Users\mkharitonov\Documents> dir \\alice.xyz.com\users\mkharitonov\1.txt
dir : Access is denied
    + CategoryInfo          : PermissionDenied: (\\alice.xyz...tonov\1.txt:String) [Get-ChildItem], UnauthorizedAccessException
    + FullyQualifiedErrorId : ItemExistsUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand

dir : Cannot find path '\\alice.xyz.com\users\mkharitonov\1.txt' because it does not exist.
    + CategoryInfo          : ObjectNotFound: (\\alice.dayf...tonov\1.txt:String) [Get-ChildItem], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

[bob]: PS C:\Users\mkharitonov\Documents> echo $env:USERNAME
mkharitonov
[bob]: PS C:\Users\mkharitonov\Documents> echo $env:USERDOMAIN
xyz
[bob]: PS C:\Users\mkharitonov\Documents>

Теперь Алиса доступна от Боба:

[bob]: PS C:\Users\mkharitonov\Documents> ping alice

Pinging alice.xyz.com [192.168.21.61] with 32 bytes of data:
Reply from 192.168.21.61: bytes=32 time=32ms TTL=125
Reply from 192.168.21.61: bytes=32 time=33ms TTL=125
Reply from 192.168.21.61: bytes=32 time=32ms TTL=125
Reply from 192.168.21.61: bytes=32 time=32ms TTL=125

Ping statistics for 192.168.21.61:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 32ms, Maximum = 33ms, Average = 32ms
[bob]: PS C:\Users\mkharitonov\Documents> ping alice.xyz.com

Pinging alice.xyz.com [192.168.21.61] with 32 bytes of data:
Reply from 192.168.21.61: bytes=32 time=32ms TTL=125
Reply from 192.168.21.61: bytes=32 time=32ms TTL=125
Reply from 192.168.21.61: bytes=32 time=33ms TTL=125
Reply from 192.168.21.61: bytes=32 time=33ms TTL=125

Ping statistics for 192.168.21.61:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 32ms, Maximum = 33ms, Average = 32ms
[bob]: PS C:\Users\mkharitonov\Documents>

В чем проблема? Почему я не могу просмотреть каталог из удаленного сеанса в bob, но я могу просматривать его нормально, когда вошел в систему в bob через RDP?

0