I have the below query pertaining to the establishment of connection between my machine(local) and Remote machine / Network machine.Can someone please let me know how to proceed on this.
I have tried New-PSSession, Create-PSSession, Enable-PSSRemoting, Enter-PSSession etc commands to establish the connection with my remote machine in one instance and with peer network machine in another instance. In both the cases, I have got the execution failed with error message ‘Access denied’ despite the fact that I have run the PowerShell in Administrator mode.
I’d suggest reading “Secrets of PowerShell Remoting,” which is on our eBooks menu.
Unless the machines are all in the same domain, you have to take several additional steps to successfully connect. The book outlines the steps for connecting between non-domain machines.
And running “as Administrator” doesn’t do anything special in this case. Even in a domain environment, you need to be using an account that the remote machine recognizes as an administrator of itself. And again, in a non-domain environment, you have to take additional steps.
And I should also point out that “listed on Network” (I’m not sure what that means) has nothing to do with it, either. “Access denied” means your computer is “finding” the remote machine just fine, but isn’t being allowed to connect. Additionally, PowerShell Remoting obviously needs to be enabled on whatever machine you connect to, and it isn’t enabled by default on client operating systems. The book does walk through all of that, and it’ll help you understand what the protocol is actually trying to do. It’s worth the time to read.