How to: Run Expression Encoder 3 under PowerShell remoting
James wanned me to explain the set of steps I use to enable Convert-Media under a PowerShell remoting.
First a disclaimer: running these steps will lower the security settings of your PC, use with caution.
Here there are:
In your encoding server (mine is called tv-server):
Enable-PSRemoting -force # Enables remoting
set-item WSMan:\localhost\Client\TrustedHosts * -force # I am not running a domain controller, so my server needs to trust everybody
set-item wsman:localhost\Shell\MaxMemoryPerShellMB 1024 -force # The default allowed memory is very low, we need to bump it so that Convert-Media have room to work.
Enable-WSManCredSSP -Role Server -force # I need the server to have access to my Windows Home Server, so it needs to autenticate using credential delegation
In your client:
function AllowDelegation($policyName)
{
$keyPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation\"+$policyName
if (test-path $keyPath)
{
rmdir $keyPath -force -rec
}
$key = mkdir $keyPath
$key.SetValue("1","WSMAN/*");
}
AllowDelegation "AllowDefaultCredentials"
AllowDelegation "AllowFreshCredentials"
Enable-WSManCredSSP -Role Client -DelegateComputer * -force
In order to remote into your server do:
Enter-PSsession <ServerName> –cred <UserName>
I have used “*” (star) in two places, that’s too broad, if you are already using a DNS suffix I would recommend to use it and change “*” to “*.mydomain.com”.
In that case you need to refer to your server as:
Enter-PSsession <ServerName>.mydomain.com –cred <UserName>
Once inside, load the Encoder module as usual and execute Convert-Media.
You could Batch background encoding jobs using the instructions from the PowerShell team.
Enjoy,
Comments
Anonymous
December 08, 2009
Terrific Oscar! I created a nice batch script to run this on one of my servers. One issue I had that maybe you know the answer to was accessing UNC paths in the remote shell. I found that I was unable to source files from another UNC path. Have you seen that issue? And if so, is there a PSSession setting that would enable that?Anonymous
December 09, 2009
You need to enable credential delegation. Make sure to pass -CredSSP as parameter to enter-psssession.