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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -