I am trying to use a PowerShell logon script to change the user's profile state 
value in the Registry to simulate a roaming profile (to allow Cookies to be 
saved properly in IE11). To do this I need the user's SID, which I am pulling 
out and then setting the Registry value.

The script I am using is this

$USERSID = ([Security.Principal.WindowsIdentity]::GetCurrent()).User.Value
$regpath = "HKLM:\Software\Microsoft\Windows 
NT\CurrentVersion\ProfileList\$USERSID"
$name = "State"
Set-ItemProperty -Path $regpath -Name $name -Value "20"

When I run this as the user (logged in), it works perfectly. The Execution 
Policy is set correctly and also I have used a script to change the Registry 
permissions at computer startup so that the user has Full Control of the target 
key.

However, when run as a GPO Logon Script the value is never set. Am I missing 
something here about how PowerShell logon scripts execute? If I use a 
third-party piece of software (AppSense EM) to do this at logon, it also works 
perfectly.

It's a Windows Server 2012 R2 system running XenApp 7.6 FP3 that I am trying to 
execute this on, for the record.

TIA,



James Rankin
EUC Director | HTG TaloSys | 07809 668579 | 
[email protected]<mailto:[email protected]>
One Trinity Green, Eldon Street, South Shields, Tyne & Wear, NE33 1SA
Tel: 0191 481 3489
Email address: [email protected]<mailto:[email protected]>
Website: www.talosys.co.uk<http://www.talosys.co.uk>
[phpy9YoGNAM]


Reply via email to