Search This Blog

Monday, May 26, 2014

Running PowerShell from Task Sequence

I often need to use a PowerShell script in a task Sequence, so in order to do that without any problems I use the following command line:

Powershell.exe -noprofile -ExecutionPolicy Bypass -file .\Script.ps1

 

image

PowerShell.exe Command-Line

The Windows PowerShell Profile

Monday, May 19, 2014

Choose a reason that best describes why you want to shut down

In some environments I really don’t want this message when trying to shut down or restart a Windows server.

image

Luckily we got a GPO setting that can remove this prompt.

Computer Configuration – Policies –Administrative Templates – System – Display Shutdown Event Tracker

image

Setting this to Disabled will remove the prompt for a reason.

image

Tuesday, May 13, 2014

PowerShell versions

Let’s take a closer look on how to identify the powerShell version installed.

We can check the version by using $psversiontable or get-host ($psversiontable is first available from version 2.0).

Version 1.0

image

Version 1.0 is available for Windows XP, Windows Server 2003, Windows Vista and Windows Server 2008.

http://support.microsoft.com/kb/926139

 

Version 2.0

image

Version 2.0 is available for Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7  and Windows Server 2008 R2..

http://support.microsoft.com/kb/968929/en-us

 

Version 3.0

image

Version 3.0 is available for Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows 8 and Windows Server 2012.

http://www.microsoft.com/en-us/download/details.aspx?id=34595

 

Version 4.0

image

Version 4.0 is available for Windows 7, Windows 2008 R2, Windows Server 2012, Windows 8.1 and Windows Server 2012 R2.

http://www.microsoft.com/en-us/download/details.aspx?id=40855

 

Version 5.0

Public preview November 2014

image

Version 5.0 is available in the Windows Management Framework 5.0 public preview.

http://www.microsoft.com/en-us/download/details.aspx?id=44987

Windows 10 build 9926:

image

Monday, May 5, 2014

Internet Explorer and no access to Security tab

Some times I find my self working on a machine with administrative rights but Internet Explorer Security tab has been removed by a Group Policy.

image

For testing only I really need to add an address to the trusted zoned.

Because of my local administrative rights I am able to temporary remove the policy until next time the GPO will be applied.

Go to the registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Control Panel\SecurityTab

And change the value from 1 to 0

image

Then go to Internet Options in Internet Explorer again and you should see the security tab.

image

If the policy has been defined on user level instead of computer level, you will find the registry entry here:

HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel\SecurityTab

image

The next thing you might find is that you are unable to add new sites because the add button is grayed out.

image

Go to the registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\Security_zones_map_edit

And change the value from 1 to 0

image

And the add button is back:

image

In some situations Custom Level may also be grayed out and you are unable to change settings.

image

Go to the registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\Security_options_edit

And change the value from 1 to 0

image

And Custom level is available again (but remember only temporary).

image

The GPO settings in play here are:

Computer Configuration\Policies\Administrative Templates\Windows Components\Internet Explorer\Internet Control Panel\Disable the Security page

or

User Configuration\Policies\Administrative Templates\Windows Components\Internet Explorer\Internet Control Panel\Disable the Security page

Computer Configuration\Policies\Administrative Templates\Windows Components\Internet Explorer\Security Zones: Do not allow users to add/delete sites

Computer Configuration\Policies\Administrative Templates\Windows Components\Internet Explorer\Security Zones: Do not allow users to change policies

image