Powershell script signing for IIS
hi all,
i've signed ps script. run script using web page (iis , ie both on same testing server). following error:
file d:\get-process.ps1 cannot loaded because execution of scripts disabled on system. please see "get-help about_signing" more details.
now i've set execution policy unrestricted (just testing) still same issue!.
any ideas? script runs fine locally ps command.
no luck :(
let me put way, i've changed allsigned unrestricted.
works on ps command line browser (on same server) still getting same error.
very strange.
so assuming have signed script (there should signature @ end of script)..something below @ end of script
<!-- sig # begin signature block --> <!-- miixxayjkozihvcnaqccoiixttccf0kcaqexczajbgurdgmcgguamgkgcisgaqqb --> <!-- gjccaqsgwzbzmdqgcisgaqqbgjccar4wjgidaqaabbafzdtgwusitrck0sypfvnr --> <!-- ageaageaageaageaageamcewcqyfkw4dahofaaququhixmxclxkcftxrnl0nlf4b -->
test way...... on admin console set execution policy "allsigned" ..then sign script (using set-authenticodesignature) , try run console ....if runs call powershell.exe php code below:
// execute powershell script
$query = shell_exec("powershell -executionpolicy allsigned -noprofile -file $psscriptpath");
echo $query;
p.s. - if use executionpolicy "unrestricted" signing script won't matter.
knowledge power{shell}.
Windows Server > Windows PowerShell
Comments
Post a Comment