> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Larry Bates
> Sent: Wednesday, October 17, 2007 7:34 PM
> To: python-win32@python.org
> Subject: Re: [python-win32] Automating logon/logoff
> 
> Matt Herbert (matherbe) wrote:
> > Hello all,
> > 
> > I am stumped trying to figure out how I can automate the 
> login/logoff 
> > procedure on Windows. Here is what I know so far. First, I 
> can logoff 
> > the system pretty easily using win32api.ExitWindowsEx() function.
> > Second, I can auto logon the system (after a reboot) using 
> the special 
> > registry keys (DefaultUserName, DefaultPassword, DefaultDomain). 
> > Third, I will have to wrap everything up in a service, so I can be 
> > running at the desktop and the logon screen.
> > 
> > So the hard part that I can't figure out, is how do I 
> programmatically 
> > initiate a logon, after a logoff? Here is the rough 
> sequence of events 
> > I want to achieve:
> > 
> > 1 MyPyService is running (at desktop)
> > 2 User requests an automated test
> > 3 MyPyService starts the test
> > 4 MyPyService logs the user off
> > 5 MyPyService wait's for something to happen
> > 6 MyPyService logs a user on
> > 
> > 
> > Any hints or help on step 6 would be greatly appreciated
> > 
> > -Matt
> 
> Maybe a use case description would help us.  Why would you 
> want a service to log users off and back on?  If you want to 
> run a task as a user there is a RunAs capability.  Automating 
> logon is probably seen as a security problem by M$.
> 
> -Larry

Here is a little background. I am automating the testing of a
wireless network client. The client must be able to establish a
connection when at the logon prompt, using one set of credentials.
If a user then log's in, the client must break the connection,
and establish a new connection using the user's credentials. It
is important that the client does this, at the correct times, so
GPO's, scripts, and domain logon's can all occur as they should.

There are hundreds of test cases that are currently manually
tested. If I can just figure out how I can log a user on, at
the right time, it would save a lot of work.

One thing I've considered, though I'm not sure if it would work,
is using a little bit of GUI automation to enter a username and
password, then click the logon button. I'm not sure if I can
access the GUI elements when I am on the logon desktop though.

-Matt
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to