0

I have created MDT environment with PSD Extension by following these steps.

There is a default step for running a powershell script(Configure).

configure

I duplicated that and created Configure1. configure1

And created a script in DeploymentShare scripts folder. scripts

Just added below content to the powershell script I created.

#PSDConfigure1.ps1
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -value 0
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"

But it seems, the above content is not applied on the machine after task sequence.

Please suggest how to execute the powershell scripts.

Sara June
  • 389
  • 4
  • 15

1 Answers1

0

It could be because of execution policy.

Try this:

 %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Noninteractive -Executionpolicy bypass -Noprofile -File {pathToFile.ps1}
  • Still same, it is not executing – Sara June Nov 24 '21 at 05:13
  • It seems it is executed only if I keep in custo taks section. – Sara June Nov 26 '21 at 11:14
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 30 '21 at 18:23
  • @SaraJune, do you have proof the script is executing? Have you looked at the SMSTS log? I'd look in there to see if its being triggered properly. Default log location is here: %WINDIR%\TEMP\DeploymentLogs, and here is the technet article... https://docs.microsoft.com/en-us/troubleshoot/mem/configmgr/troubleshooting-reference – SophisticatedBear Nov 30 '21 at 18:55