This topic contains 6 replies, has 3 voices, and was last updated by
October 31, 2017 at 10:12 pm #83308
October 31, 2017 at 11:11 pm #83309KeymasterPoints: 1,638Rank: Community Hero
Provided the location you specify exists and you have permission, and the Remoting endpoint doesn't prevent it, then yes.
November 1, 2017 at 12:50 pm #83351ParticipantPoints: 1Rank: Member
What happens if you:
PS> Enter-PSSession $Hostname
PS> Test-Path $ThePathYouWantToSet-LocationTo
November 1, 2017 at 4:09 pm #83402
Thank you.... Don
The location does exist.
This is a domain computer. I can use the set-location command when I am physically on the machine:
PS C:\WINDOWS\system32> hostname
PS C:\WINDOWS\system32> Set-Location -Path \\owsms\Infotech
When connect to OWT2077 using enable-pssession and try using the set-location command I get this:
[owt2077]: PS C:\Users\e139022\Documents> Set-Location "\\owsms\infotech"
Set-Location : Access is denied
+ CategoryInfo : PermissionDenied: (\\owsms\infotech:String) [Set-Location], UnauthorizedAcc
+ FullyQualifiedErrorId : ItemExistsUnauthorizedAccessError,Microsoft.PowerShell.Commands.SetLocation
I don't understand where the PermissionDenied is coming from?
Thank you again for your input!
November 1, 2017 at 4:20 pm #83414KeymasterPoints: 1,638Rank: Community Hero
Ah. You're attempting to connect to a UNC. That won't work in the default Remoting world because your delegated credential cannot be delegated across a second hop. This is “the second hop problem;” see same in “Secrets of PowerShell Remoting” on our ebooks menu. You would be perhaps better cresting a new PSDrive to the UNC, as you can provide explicit credentials to do so.
November 1, 2017 at 4:42 pm #83423
Thank you Don!
I have to say – I didn't expect to get a response from someone with your level of skill and recognition. I am pretty new to PowerShell but I have completely absorbed myself in it. I have taken your "Play by Play: PowerShell from Idea to Action" on Pluralsight. I also have listened to you on Channel 9. I have taken the courses on MVA taught by Jason Helmick and Jeffery Snover. Jeffery Snover is always touting how great the PowerShell community is. After this experience – I am can see why. You guys are all great teachers and I enjoy learning from all of you. So Thank You for sacrifices and time you give.
November 1, 2017 at 8:13 pm #83435ParticipantPoints: 1Rank: Member
Don ... that guy 😉
The topic ‘set-location and enter-pssession’ is closed to new replies.