Connecting Windows server to Local Drive

Hi

I have server xxxprod1 on my work network. I want to test some services using get-service.

BUT I do not want to REMOTE into the server but rather use it on local powershell cmd prompt .

I tried map to a drive \xxxprod1\c$ which was succesful and mapped to my “Y” drive.

then was able to set-location “Y:” which was succesful.

But when i run GET-SERVICE , I DO NOT SEE SAME SERVICES as i did when i’m REMOTING into the computer there and run GET-SERVICE.

How can I run the Get-service on my local computer i.e connect to Network server and test on my local Powersell/prompt instead off remoting to the SERVER.

Thanks
Sanjay

Sorry but I figured it out.

get-service -computername xxxprod1

Thanks
Sunny

Invoke-Expression allows you use -computername too and specify a script block to execute on the server as well.

Invoke-Command I think is what you meant

Roger that. I meant Invoke-Command.