Solved

Powershell Remote With Remote Module

Posted on 2013-01-21
2
710 Views
Last Modified: 2013-01-22
I have a server that I ran Enable-PSRemoting on successfully.  

I am able to run Enter-PSSession <computername> from my local workstation and successfully connect.

I need to somehow import a module from the remote server into the session I am using and be able to use cmdlets from that module.  I don't want to have to import the module locally.

Is that even possible?
0
Comment
Question by:jonathanbyers
2 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 350 total points
ID: 38803515
Try this..
$Session = New-PSSession "ServerName"
Invoke-Command -Session $Session {Import-Module RemoteDesktopServices}
Invoke-Command -Session $Session {Get-PSDrive}

Open in new window

0
 
LVL 68

Assisted Solution

by:Qlemo
Qlemo earned 150 total points
ID: 38804398
You can also combine the complete script into a single block, which is usually more straight-forward (I'm using the same lines as Subsun as an example):
$Session = New-PSSession "ServerName"
Invoke-Command -Session $Session {
  Import-Module RemoteDesktopServices
  Get-PSDrive
}

Open in new window

0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You may have a outside contractor who comes in once a week or seasonal to do some work in your office but you only want to give him access to the programs and files he needs and keep privet all other documents and programs, can you do this on a loca…
A procedure for exporting installed hotfix details of remote computers using powershell
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

30 Experts available now in Live!

Get 1:1 Help Now