views:

603

answers:

3

I want to install Powershell to 600 xp computers and use it as the main processing shell, for example replacing batch scripts, VB scripts some other little programs. The installation process is not a problem. Some issues I think I'm going to come across are

1) Changing permissions to allow powershell to run scripts

2) The speed of poweshell starting

3) Using Poweshell for logon/logoff scripts with GPO

Problem 2, there is a scripts that is supposed to speed up powershell, but it seems to need to be run as an administrator (which of course isn't something that normal users do). Has anyone had any experience with using poweshell in this way?

A: 

Changing permissions to allow Powershell scripts is possible to do via group policy.

Microsoft provide ADM templates here, there is only one option "Turn on Script Execution" and can be assigned at a user or computer level.

Tubs
+2  A: 

To speed up the start of PowerShell, Jeffrey Snover (the partner/architect responsible for PowerShell) provides an "Update-GAC" script here.

Basically, it is just running through the assemblies that are loaded for PowerShell and NGen'ing (pre-compiling the IL to machine code) them. This does speed up the start of PowerShell.

Another trick is to run PowerShell with the -nologo and -noprofile switches.

This will skip the profile scripts and splash logo.

There is a product for using PowerShell for logon/logoff scripts from Special Operations Software. There are other ways to do it also.

%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -nologo -noprofile
Steven Murawski
Do you know if this needs to be run once per computer, once per boot, or once per user?
Tubs
Script only seems to needed to be run once. Even with -nologo and -noprofile i'm looking, on the first run, a 10 second startup time to list a directory. Of course after this, it is pretty much instantanious.
Tubs
Yeah.. if you only have to run one script, PowerShell can be a bit slow for the initial startup. If the script has to perform a number of actions, PowerShell can be fast, but there will be that initial performance hit.
Steven Murawski
A: 

It seems it's possible to run poweshell silently, but not just by calling itself. This article has more information.

So answering my own questions

  1. This can be done via GPOs
  2. First run takes at least 10 seconds on our computers. this could add that time onto the logon time which is unacceptable.
  3. This seems fairly simple to do, using the scripts above is invisibility is needed, or by calling the powershell exe and passing it startup options.

On our computers, to use powershell for logon seems not to be worthwhile just because of the logon time increase.

Tubs