PC Review


Reply
Thread Tools Rating: Thread Rating: 7 votes, 4.43 average.

Disable programmatically the "Fast User Switching"

 
 
Viviana Vc
Guest
Posts: n/a
 
      30th Apr 2004
Hi all,

I would like programmatically to disable "Fast User Switching" (FUS) (as
an option for the user). As
I understood from what I read there are 2 ways for doing this:
1) replace the msgina.dll, as FUS doesn't work with a custom msgina.dll
2) set into the registry: HKLM\Software\Microsoft\Windows
NT\CurrentVersion\Winlogon -> AllowMultipleTSSessions to 0

I would like to use the second way of disabling and I have some
questions:
1) Some are saying that this entry might not be in the registry. Can
this be true? If yes, if I just add it there with the 0 value will it
disable the FUS?
If indeed something from this path can miss on a WinXP, is it just the
string or it can be one of the keys from the paths (like for instance
Winlogon)?

2) Is this solution an ok solution, or it can not guarantee that by just
setting the AllowMultipleTSSessions to 0 the FUS will be disabled?

Thanks a lot in advance,
Viv
 
Reply With Quote
 
 
 
 
Ramesh [MVP]
Guest
Posts: n/a
 
      30th Apr 2004
Viv,

1st solution disables Welcome Screen as well.
2nd solution should work.

One entry of AllowMultipleTSSessions will exist anyway

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AllowMultipleTSSessions
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system\AllowMultipleTSSessions (not present by default)

Set AllowMultipleTSSessions to 0 the FUS will be disabled. The AllowMultipleTSSessions value present under 'policies' will override the value under WinLogon. (If Winlogon\AllowMultipleTSSessions is set to 0 and policies\system\AllowMultipleTSSessions is set to 1, FUS WILL work.)

HTH

--
Ramesh - Microsoft MVP
Windows XP Shell
http://www.mvps.org/sramesh2k


"Viviana Vc" <(E-Mail Removed)> wrote in message news:c6tumt$fotfi$(E-Mail Removed)...
Hi all,

I would like programmatically to disable "Fast User Switching" (FUS) (as
an option for the user). As
I understood from what I read there are 2 ways for doing this:
1) replace the msgina.dll, as FUS doesn't work with a custom msgina.dll
2) set into the registry: HKLM\Software\Microsoft\Windows
NT\CurrentVersion\Winlogon -> AllowMultipleTSSessions to 0

I would like to use the second way of disabling and I have some
questions:
1) Some are saying that this entry might not be in the registry. Can
this be true? If yes, if I just add it there with the 0 value will it
disable the FUS?
If indeed something from this path can miss on a WinXP, is it just the
string or it can be one of the keys from the paths (like for instance
Winlogon)?

2) Is this solution an ok solution, or it can not guarantee that by just
setting the AllowMultipleTSSessions to 0 the FUS will be disabled?

Thanks a lot in advance,
Viv
 
Reply With Quote
 
 
 
 
Viviana Vc
Guest
Posts: n/a
 
      3rd May 2004
Thanks for your answer. I will try ...

Thanks,
Viv

On Fri, 30 Apr 2004 22:13:27 +0530, "Ramesh [MVP]"
<sramesh2k@\REMOV_NOSPAM\.hotmail.com> wrote :

>Viv,
>
>1st solution disables Welcome Screen as well.
>2nd solution should work.
>
>One entry of AllowMultipleTSSessions will exist anyway
>
>HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AllowMultipleTSSessions
>HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system\AllowMultipleTSSessions (not present by default)
>
>Set AllowMultipleTSSessions to 0 the FUS will be disabled. The AllowMultipleTSSessions value present under 'policies' will override the value under WinLogon. (If Winlogon\AllowMultipleTSSessions is set to 0 and policies\system\AllowMultipleTSSessions is set to 1, FUS WILL work.)
>
>HTH


 
Reply With Quote
 
Ramesh [MVP]
Guest
Posts: n/a
 
      3rd May 2004
Welcome.

--
Ramesh - Microsoft MVP
Windows XP Shell
http://www.mvps.org/sramesh2k
---------------------------------------
What You Should Know About the Sasser Worm and It Variants:
http://www.microsoft.com/security/incident/sasser.asp
---------------------------------------


"Viviana Vc" <(E-Mail Removed)> wrote in message news:c753ls$if54d$(E-Mail Removed)...
Thanks for your answer. I will try ...

Thanks,
Viv

On Fri, 30 Apr 2004 22:13:27 +0530, "Ramesh [MVP]"
<sramesh2k@\REMOV_NOSPAM\.hotmail.com> wrote :

>Viv,
>
>1st solution disables Welcome Screen as well.
>2nd solution should work.
>
>One entry of AllowMultipleTSSessions will exist anyway
>
>HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AllowMultipleTSSessions
>HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system\AllowMultipleTSSessions (not present by default)
>
>Set AllowMultipleTSSessions to 0 the FUS will be disabled. The AllowMultipleTSSessions value present under 'policies' will override the value under WinLogon. (If Winlogon\AllowMultipleTSSessions is set to 0 and policies\system\AllowMultipleTSSessions is set to 1, FUS WILL work.)
>
>HTH


 
Reply With Quote
 
Viviana Vc
Guest
Posts: n/a
 
      3rd May 2004
Hi all,

In some conditions from MyApp when a FUS occurs I have to force instead
a real 'Log Off' to be sure that all the applications of that user are
closed. So for instance user A is working then he is chosing a FUS, so
in that moment from MyApp I would like to force a real 'Log Off'.

In MyApp I get the message when the user is doing a FUS by:
WM_WTSSESSION_CHANGE -> WTS_SESSION_LOCK, so now in WTS_SESSION_LOCK I
would like to force a 'Log Off' instead.

I tried doing this in several ways:
1) ExitWindowsEx(EWX_LOGOFF, SHTDN_REASON_MAJOR_OPERATINGSYSTEM) but
even though it returns success it actually doesn't do a log off of the
current user.
It's working if I use also EWX_FORCE flag, but then the system is not
waiting for the user to save any unsaved data. It's not behaving like a
normal 'Log Off'.
2) I tried to run logoff.exe when I get the WTS_SESSION_LOCK but nothing
happens
3) I tried WTSLogoffSession, but this behaves like ExitWindowsEx with
the EWX_FORCE flag, meaning that it's a 'brutal' log off.

Is there any way to do a normal 'Log Off' when I get the
WTS_SESSION_LOCK msg? (normal 'Log Off' means the kind of log off you
get when the user choses log off instead of switch user)

Thanks in advance,
Viv


On Fri, 30 Apr 2004 22:13:27 +0530, "Ramesh [MVP]"
<sramesh2k@\REMOV_NOSPAM\.hotmail.com> wrote :

>Viv,
>
>1st solution disables Welcome Screen as well.
>2nd solution should work.
>
>One entry of AllowMultipleTSSessions will exist anyway
>
>HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AllowMultipleTSSessions
>HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system\AllowMultipleTSSessions (not present by default)
>
>Set AllowMultipleTSSessions to 0 the FUS will be disabled. The AllowMultipleTSSessions value present under 'policies' will override the value under WinLogon. (If Winlogon\AllowMultipleTSSessions is set to 0 and policies\system\AllowMultipleTSSessions is set to 1, FUS WILL work.)
>
>HTH


 
Reply With Quote
 
Viviana Vc
Guest
Posts: n/a
 
      3rd May 2004
Hi Ramesh,

I have just tried what you wrote me and it's indeed true: "value present
under 'policies' will override the value under WinLogon". I haven't
found this info anywhere in MSDNL or NGs, so thanks a lot again.

This means actually that for disabling FUS I should care only about:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system\AllowMultipleTSSessions
by creating it if needed and setting it to 0.
I don't need to also set or care about HKLM\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon\AllowMultipleTSSessions as this is anyhow
overwritten right?

(I am asking this because there is XP Home, XP Pro, 2 service packs, and
as I don't have access to all of these combinations I would like to be
sure that the above is true for all of these)

Thanks a lot,
Viv


On Mon, 3 May 2004 16:56:53 +0530, "Ramesh [MVP]"
<sramesh2k@\REMOV_NOSPAM\.hotmail.com> wrote :

>Welcome.


 
Reply With Quote
 
Ramesh [MVP]
Guest
Posts: n/a
 
      3rd May 2004
Viv,

Yes. For the 2nd question, will test in a Windows XP Home unit and let you know.

--
Ramesh - Microsoft MVP
Windows XP Shell
http://www.mvps.org/sramesh2k
---------------------------------------
What You Should Know About the Sasser Worm and It Variants:
http://www.microsoft.com/security/incident/sasser.asp
---------------------------------------


"Viviana Vc" <(E-Mail Removed)> wrote in message news:c75cip$ifnkq$(E-Mail Removed)...
Hi Ramesh,

I have just tried what you wrote me and it's indeed true: "value present
under 'policies' will override the value under WinLogon". I haven't
found this info anywhere in MSDNL or NGs, so thanks a lot again.

This means actually that for disabling FUS I should care only about:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system\AllowMultipleTSSessions
by creating it if needed and setting it to 0.
I don't need to also set or care about HKLM\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon\AllowMultipleTSSessions as this is anyhow
overwritten right?

(I am asking this because there is XP Home, XP Pro, 2 service packs, and
as I don't have access to all of these combinations I would like to be
sure that the above is true for all of these)

Thanks a lot,
Viv


On Mon, 3 May 2004 16:56:53 +0530, "Ramesh [MVP]"
<sramesh2k@\REMOV_NOSPAM\.hotmail.com> wrote :

>Welcome.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Disable programmatically the "Fast User Switching" Ramesh [MVP] Windows XP Logo 0 4th May 2004 07:20 AM
Re: Disable programmatically the "Fast User Switching" Ramesh [MVP] Windows XP Basics 0 4th May 2004 07:20 AM
Re: Disable programmatically the "Fast User Switching" Ramesh [MVP] Windows XP General 0 4th May 2004 07:20 AM
Disable programmatically the "Fast User Switching" Viviana Vc Windows XP Basics 5 3rd May 2004 01:13 PM
Disable programmatically the "Fast User Switching" Viviana Vc Windows XP General 6 3rd May 2004 01:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:04 PM.