I need help (Remote connecting)

I just began reading and learning Powershell, but i have this issue which has been nagging me for 2 days now - I need to connect to my server.

Server: A simple Windows 2012 server This server is up via VirtuelBox.
Computer: A Windows 8 (NOT pro)
For arguements sake, lets say the server has the IP of 192.168.1.1 and the PC i am using, 192.168.1.2
Now, Can someone, please <3 - Tell me, step by step, in a manner that a child of 5 can understand, How i connect to my VM-server. (This is all run locally, for now)

If u need any more info, don’t hesitate to ask. and, Thanks, a Whole bunch.

It sounds as if you are having difficulty remoting into the server. A great resource to read through for remoting is a free ebook written by Don Jones that you can download from https://powershell.org/newsletter/. It is called Secrets of PowerShell Remoting and should cover all the issues that you might be having.

Arh, Thanks, i’ll look it through.

One thing though. I dont know if you’ve seen it but, on that "jumpstart to powershell " or something like that, It’s a series of training videos to learn Powershell. Anyway - when he gets into remoting etc. he writes Things like enter-pssession -Computername <computernames>

How exactly does IT know, that when he writes dc it knows what server he’s talking about? I’ve tried with IP addresses, adding them to trustedhosts, Making sure the firewall wasn’t blocking, activating it on each end, etc. and yet i keep hitting “Access Denied”

Anyway, i just wanted to know about the names, Is that ADComputer that does that?

[quote=9227]Arh, Thanks, i’ll look it through.

One thing though. I dont know if you’ve seen it but, on that “jumpstart to powershell ” or something like that, It’s a series of training videos to learn Powershell. Anyway – when he gets into remoting etc. he writes Things like enter-pssession -Computername <computernames>

How exactly does IT know, that when he writes dc it knows what server he’s talking about? I’ve tried with IP addresses, adding them to trustedhosts, Making sure the firewall wasn’t blocking, activating it on each end, etc. and yet i keep hitting “Access Denied”

Anyway, i just wanted to know about the names, Is that ADComputer that does that?

[/quote]

I’m having a little trouble understanding you. So I will try answering what I hope are your questions.

Take for example the following command: enter-pssession -Computername DC

The computer you’re running this command from most likely will be on the same domain as the remote computer DC is on. Or, the domain the computer you’re running the command from is on a domain that trusts the domain DC is on.

The other scenario you might be talking about is if the computer you’re running the command from is in a workgroup and the remote computer, DC, is in a domain. In that case the computer you’re running the command from will not know how to find DC. To get around this you will want to tell the computer where to find the computer named DC by editing the HOST file. This file is normally found \Windows\System32\Drivers\ETC

I would recommend that you start with the help system for remoting.

Using your original command I would probably run something like this:

invoke-command -computername ‘192.168.1.1’ -credential domain\username -scriptblock {get-service}

The command above would retrieve the services on the remote computer.

In order for the example that I gave you to work, you need to meet two requirements.

  1. You have to make sure that the remote computer at 192.168.1.1 is enabled for PSRemoting. There are many ways to do this and I’ll let you look those up. However, the fastest way would be for you to connect to 192.168.1.1, open a PowerShell window, and type in: enable-psremoting.

  2. The remote computer and your computer trust each other. This is required because you’re using an IP address and not a Fully Qualified Domain name. For testing purposes only you can accomplish this with the following command: Set-Item WSMan:\localhost\client\trustedhosts * -Force You should look up the help for the command I just gave you along with WSMAN so you know what you’re modifying.

I hope this helps get you started.