Book Image

Hyper-V Security

By : Eric Siron, Andrew Syrewicze
Book Image

Hyper-V Security

By: Eric Siron, Andrew Syrewicze

Overview of this book

Table of Contents (15 chapters)
Hyper-V Security
About the Authors
About the Reviewers

Using custom PowerShell Remoting endpoints

While the ability to operate directly at a remote PowerShell prompt is certainly an enticing reason to use PowerShell Remoting, the benefits don't stop there. Only members of the host's local Administrators group are allowed to connect using the direct methods displayed so far. However, with a little effort, you can design custom endpoints and delegate their usage to anyone as necessary.

You begin by defining the capabilities of the endpoint. This is done with the New-PSSessionConfigurationFile cmdlet, which, as its name implies, creates a file that lays out the structure of the endpoint. A sample usage of this cmdlet is shown as follows:

New-PSSessionConfigurationFile -Path C:\Scripts\GetVM.pssc -SessionType RestrictedRemoteServer -ModulesToImport HyperV -VisibleCmdlets Get-VM -VisibleFunctions Get-VM -LanguageMode NoLanguage

With this, we have created a descriptor file for a custom endpoint that can't do anything but run the Get-VM cmdlet. The...