c# - How do I create a "Remote Powershell" server object that can be called by clients? -


in microsoft exchange, it's common clients call remote server object using following commands

$s = new-pssession -configurationname microsoft.exchange -connectionuri http://server01/powershell/ -authentication kerberos import-pssession $s 

my understanding no software needed on client, , calls remotely executed on server "server01"

my question is:

  1. assuming have basic powershell object created, how expose in such way can called in similar manner client?

  2. is "remoting" possible arbitrary powershell commandlets, or there set of prerequsites must met?

to add keith has provided, not cmdlets, proxy functions. functions depend on rbac roles belong in exchange. if aren't member of role group that's authorized perform function don't proxy functions cmdlets. if try use them tell command not found. also, don't have use import-pssession. if you're using limited number of cmdlets, once have session established can use invoke-command targeted session run exchange cmdlets , save overhead of doing import load proxy functions available cmdlets local session.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -