The PowerShell Scripting and Toolmaking Book by Don Jones and Jeff Hicks

The PowerShell Scripting and Toolmaking Book by Don Jones and Jeff Hicks

Author:Don Jones and Jeff Hicks
Language: eng
Format: mobi, epub
Publisher: leanpub.com
Published: 2017-01-09T16:00:00+00:00


You can have multiple roles defined, and someone could belong to multiple groups. For your primer purposes we’re keeping it simple.

When you are ready, go ahead and create the .pssc file.

1 New-PSSessionConfigurationFile -Path .\ShareAdmin.pssc ` 2 -SessionType RestrictedRemoteServer ` 3 -RunAsVirtualAccount ` 4 -RoleDefinitions $roles ` 5 -Description "JEA Share Admin endpoint"

Once you’ve completed your configuration you should test it.

1 Test-PSSessionConfigurationFile .\ShareAdmin.pssc

The configuration needs to be set up on the remote server so you’ll need to copy the necessary files to the server.

1 $s = New-PSSession -ComputerName chi-fp02 2 #copy the pssc file to C:\ 3 copy .\shareadmin.pssc -Destination C:\ -ToSession $s 4 5 #copy the module with the role configuration 6 copy .\ShareAdmin -Container -Recurse ` 7 -Destination 'C:\Program Files\WindowsPowerShell\Modules' -ToSession $s



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.