How to easily read the username instead of SID on a TS/Citrix server


image

I found this little trick in my RSS feeds and I must say this is really a KISS (keep it simple stupid) solution that everybody in a TS / Citrix environment can use.

I wanted to walk through the registry of a specific terminal server user. So I logged onto that terminal server too (using my own credentials) and opened up regedit… And then it hit me (again). I need to know the SID of the user to open his part of the registry.

To prevent having to get a SID ever again I implemented the earlier mentioned trick. I launched the RES PowerFuse console, went to Powerlaunch; User Registry and added a new String Value directly under HKEY_CURRENT_USER. I named the String "Username" and entered "%username%" as the value.

In the original blog post this will be done with PowerFuse. If you don’t use PowerFuse you can set this registry setting via your logon script.

If you’re running a logon script via Kix, you can add the following line:

WriteValue("HKEY_CURRENT_USER","UserID","@Userid","REG_SZ")   

Or if you’re running a batch script, you can add the following line:

REG ADD "HKCU" /v "UserID"  /d "%Username%" /t REG_SZ /f 

When the user runs the logon script, the registry setting will be imported and you can browse through the registry without knowing the SID of al your users.

image

Source: http://resinside.blogspot.com/2009_05_01_archive.html#6904219593671371315

Advertisements

Event ID: 1505


Gisteren kreeg ik de melding binnen dat het inloggen op de Citrix XenApp / Terminal Server niet meer lukte. Tijdens het inloggen verscheen de volgende error:

Windows cannot load the user’s profile but has logged you on with the default profile for the system. Detail: Insufficient system resources exist to complete the requested service.

In de Applicationlog van de server stond de onderstaande Event gelogt:

image

Nadat ik deze in google had geschoten kwam KB935649 naar voren en daar stond de volgende oplossing:

To resolve this problem, modify the registry to increase the PoolUsageMaximum value and the PagedPoolSize value. To do this, follow these steps:

1. Click Start, click Run, type regedit, and then click OK.

2. Locate and then click the following registry subkey:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management

3. On the Edit menu, point to New, and then click DWORD Value.

4. In the New Value #1 box, type PoolUsageMaximum, and then press ENTER.

5. Right-click PoolUsageMaximum, and then click Modify.

6. In the Value data box, type 60, and then click OK.

7. If the PagedPoolSize registry entry exists, go to step 8. If the PagedPoolSize registry entry does not exist, create it. To do this, follow these steps:

a.  On the Edit menu, point to New, and then click DWORD Value.

b. In the New Value #1 box, type PagedPoolSize, and then press ENTER.

8. Right-click PagedPoolSize, and then click Modify.

9. In the Value data box, type ffffffff, and then click OK.

10. Exit Registry Editor, and then restart the computer.

Je kunt ook de volgende regkey importeren op de terminal server KB935649.reg:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management]
“PagedPoolSize”=dword:ffffffff
“PoolUsageMaximum”=dword:00000060

Helaas zijn de nieuwe settings pas van kracht nadat de server opnieuw is opgestart. De error heeft geen invloed op de bestaande sessies. Ik heb daarom op de Server de logins tijdelijk uitgeschakeld en deze na het herstarten van de server weer ingeschakeld. Daarna was het probleem ook verholpen.