2

Error Message Permissions Setup

I've checked the path names and they are correct. I've tried editing the permissions and they seem fine.

What else should I try?

EDIT:

I also tried this way: http://damonjohns.com/2014/03/12/removing-windows-8-1-modern-applications-during-your-mdt-sccm-task-sequence/

I don't get the screen but the script does not seem to be copying the ps1 files over to execute them.

My Script:

powershell.exe -Command “set-ExecutionPolicy Unrestricted -Force; cpi ‘%DEPLOYROOT%\Applications\SCRIPT - Enable Remote Managament By Opening Firewall Rules\script_enable_remote_management_open_firewall_rules.ps1′ -destination c:\; c:\script_enable_remote_management_open_firewall_rules.ps1"

EDIT: Everytime I check C:\ I do not see my rules copied over. I have also now had everything go thru without getting a FAILURE screen but I do not see the scripts and do not see them executed.

Jason
  • 3,821
  • 17
  • 65
  • 106

1 Answers1

2

To run power shell scripts you will need to add it as a Task Sequence item. You can do this by adding the Run PowerShell Script entry into your Task Sequence.

Make sure that you add it after the system has restarted from installing/applying the image.

How to add into task sequence.

In the task configuration you will need to point to the ps1 file that houses your commands. You may be able to execute a single command (I am not sure).

Elliot Huffman
  • 1,169
  • 1
  • 10
  • 22
  • Hey, yes, I tried that with no success. ;/ – Jason Jul 07 '14 at 01:26
  • It looks like you also need to add `.net framework`, `DISM Cmdlets` and `Enhanced storage`. I will update the picture if that works. I had forgot to put that in :-P – Elliot Huffman Jul 07 '14 at 13:49
  • No luck. What do you use for a CLI in your Task Sequence to get the system to run PS Scripts? – Jason Jul 07 '14 at 14:30
  • Did you update your deployment share images? – Elliot Huffman Jul 07 '14 at 15:32
  • I would personally recommend to rebuild the images completely. – Elliot Huffman Jul 07 '14 at 15:33
  • Yes, I always do full rebuilds. – Jason Jul 07 '14 at 15:36
  • In your task sequence are you adding the `run power shell script` entry? – Elliot Huffman Jul 07 '14 at 15:41
  • I just dug this up, check it out:http://scriptimus.wordpress.com/2012/09/14/ltizti-powershell-using-powershell-in-task-sequences/ It should solve your power shell issue. Plus this guy also helps to make a ZTI environment with MDT. – Elliot Huffman Jul 07 '14 at 15:44
  • I'll try that. I just noticed a comment about GPO that restricts PS on a domain level. I'll try disabling that. Maybe that has an effect. – Jason Jul 07 '14 at 16:52
  • OK. Keep me posted – Elliot Huffman Jul 07 '14 at 18:32
  • As far as I know that was probably the issue. The other thing I noticed was that I also was trying to do the scripts as an application. – Jason Jul 07 '14 at 19:05
  • Did you try running the scripts as a powershell script? (Task Sequence) I will revise the answer based on your reply – Elliot Huffman Jul 07 '14 at 19:45
  • What I did was is I set them up as an Application: http://oi61.tinypic.com/2nuua6a.jpg then I add an application and link to that script from within the Task Sequence. (basically going for the idea to be able to select and run what scripts that I want. now if I don't do it as an application and just link to the script as a powershell script options from within Task sequence, it works.). Thanks for your help and time. I recently moved to this topic now: http://serverfault.com/questions/610710/running-powershell-scripts-as-an-application-in-mdt-2013 – Jason Jul 07 '14 at 19:51
  • 1
    Thanks, I will update the answer to this question for other people :) – Elliot Huffman Jul 07 '14 at 19:54