Evitar que se cierre programa desde el administrador de tareas.

2,183 views
Skip to first unread message

Miguel Antúnez

unread,
Jun 16, 2011, 2:24:07 PM6/16/11
to publice...@googlegroups.com, vfo...@gruposyahoo.com.ar, mundovis...@googlegroups.com
Buenas Tardes. 
Quisiera saber como hacer lo indicado, evitar que con el administrador de tareas me cierren mi programa en ejecución.

Saludos.

--
Miguel Angel Antúnez Camones
Especialista en SQL Server

mant...@frenosa.com.pe
mant...@gmail.com
miguel_...@msn.com
Cel. 997914428

Microsoft Active Professional
Membresía FY11-4D8A908D4C470

Norberto

unread,
Jun 16, 2011, 2:34:01 PM6/16/11
to Comunidad de Visual Foxpro en Español
Si logras eso te van a desenchufar el cable ;>)

On 16 jun, 15:24, Miguel Antúnez <mantun...@gmail.com> wrote:
> Buenas Tardes.
> Quisiera saber como hacer lo indicado, evitar que con el administrador de
> tareas me cierren mi programa en ejecución.
>
> .
>
> --
> Miguel Angel Antúnez Camones
> Especialista en SQL Server
>
> mantu...@frenosa.com.pe
> mantun...@gmail.com
> miguel_antu...@msn.com

extremo

unread,
Jun 16, 2011, 2:41:55 PM6/16/11
to Comunidad de Visual Foxpro en Español
jajjaja cierto Norberto,

Ademas si logras eso Miguel, pues me doy un tiro en la cabeza
jajajajaja

Bendiciones
> > Membresía FY11-4D8A908D4C470- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -

DIEGO A. CALLEGARI

unread,
Jun 16, 2011, 2:50:41 PM6/16/11
to publice...@googlegroups.com
Alguna vez, utilice un programa externo, que ocultaba determinadas
aplicaciones en el administrador de tareas.

Algo hay, estoy seguro, pero no recuerdo ni el nombre, ni de donde lo
conseguí....¿has probado buscar en softonic.com o similares?


Diego A. Callegari


-----Mensaje original-----
De: publice...@googlegroups.com
[mailto:publice...@googlegroups.com] En nombre de extremo
Enviado el: Jueves, 16 de Junio de 2011 03:42 p.m.
Para: Comunidad de Visual Foxpro en Español
Asunto: [vfp] Re: Evitar que se cierre programa desde el administrador de
tareas.

Luis Mata

unread,
Jun 16, 2011, 2:53:24 PM6/16/11
to publice...@googlegroups.com
a tanto lio, mejo establece politicas y reglas, evita la fatiga.

-----Mensaje original-----
From: DIEGO A. CALLEGARI
Sent: Thursday, June 16, 2011 1:50 PM
To: publice...@googlegroups.com
Subject: RE: [vfp] Re: Evitar que se cierre programa desde el administrador
de tareas.

Alguna vez, utilice un programa externo, que ocultaba determinadas


aplicaciones en el administrador de tareas.

Algo hay, estoy seguro, pero no recuerdo ni el nombre, ni de donde lo

consegu�....�has probado buscar en softonic.com o similares?


Diego A. Callegari


-----Mensaje original-----
De: publice...@googlegroups.com
[mailto:publice...@googlegroups.com] En nombre de extremo
Enviado el: Jueves, 16 de Junio de 2011 03:42 p.m.

Para: Comunidad de Visual Foxpro en Espa�ol


Asunto: [vfp] Re: Evitar que se cierre programa desde el administrador de
tareas.

jajjaja cierto Norberto,

Ademas si logras eso Miguel, pues me doy un tiro en la cabeza
jajajajaja

Bendiciones


On 16 jun, 14:34, Norberto <gmnor...@gmail.com> wrote:
> Si logras eso te van a desenchufar el cable ;>)
>

> On 16 jun, 15:24, Miguel Ant�nez <mantun...@gmail.com> wrote:
>
>
>
> > Buenas Tardes.
> > Quisiera saber como hacer lo indicado, evitar que con el administrador
de

> > tareas me cierren mi programa en ejecuci�n.
>
> > .
>
> > --
> > Miguel Angel Ant�nez Camones


> > Especialista en SQL Server
>
> > mantu...@frenosa.com.pe
> > mantun...@gmail.com
> > miguel_antu...@msn.com
> > Cel. 997914428
>
> > Microsoft Active Professional

> > Membres�a FY11-4D8A908D4C470- Ocultar texto de la cita -

Miguel Antúnez

unread,
Jun 16, 2011, 3:37:19 PM6/16/11
to publice...@googlegroups.com

**************************************

* OCULTAR UNA APLICACION DEL CUADRO DE

* DIALOGO "CERRAR PROGRAMA" (CTRL+ALT+SUPR)

**************************************

 

DECLARE LONG GetCurrentProcessId IN "kernel32"

 

DECLARE LONG RegisterServiceProcess IN "kernel32";

  LONG dwProcess,;

  LONG dwType

 

=RegisterServiceProcess( GetCurrentProcessId(), 1 )

******************************************************************

-esta aplicación leyendo en Internet solo sirve para win9x 


-lo que quiero justamente es hacer que apaguen sus maquinas. este aplicativo los sacaría de red.


pero para que funcione necesito que no lo puedan dar "terminar proceso" 


-por el tema de políticas si se me hace fácil desactivar el administrador de tareas, pero no quiero eso, ya que cualquier otro programa  los usuarios lo podrían dar como terminar, deseo que ese programa en especifico este bloqueado.


Saludos.



El 16 de junio de 2011 13:53, Luis Mata <lm...@cclf.com.pe> escribió:
a tanto lio, mejo establece politicas y reglas, evita la fatiga.

-----Mensaje original----- From: DIEGO A. CALLEGARI
Sent: Thursday, June 16, 2011 1:50 PM
To: publice...@googlegroups.com
Subject: RE: [vfp] Re: Evitar que se cierre programa desde el administrador de tareas.


Alguna vez, utilice un programa externo, que ocultaba determinadas
aplicaciones en el administrador de tareas.

Algo hay, estoy seguro, pero no recuerdo ni el nombre, ni de donde lo
conseguí....¿has probado buscar en softonic.com o similares?



Diego A. Callegari




-----Mensaje original-----
De: publice...@googlegroups.com
[mailto:publice...@googlegroups.com] En nombre de extremo
Enviado el: Jueves, 16 de Junio de 2011 03:42 p.m.
Para: Comunidad de Visual Foxpro en Español

Asunto: [vfp] Re: Evitar que se cierre programa desde el administrador de
tareas.

jajjaja cierto Norberto,

Ademas si logras eso Miguel, pues me doy un tiro en la cabeza
jajajajaja

Bendiciones


On 16 jun, 14:34, Norberto <gmnor...@gmail.com> wrote:
Si logras eso te van a desenchufar el cable ;>)

On 16 jun, 15:24, Miguel Antúnez <mantun...@gmail.com> wrote:



> Buenas Tardes.
> Quisiera saber como hacer lo indicado, evitar que con el administrador
de
> tareas me cierren mi programa en ejecución.

> .

> --
> Miguel Angel Antúnez Camones

> Especialista en SQL Server

> mantu...@frenosa.com.pe
> mantun...@gmail.com
> miguel_antu...@msn.com
> Cel. 997914428

> Microsoft Active Professional
> Membresía FY11-4D8A908D4C470- Ocultar texto de la cita -


- Mostrar texto de la cita -





--
Miguel Angel Antúnez Camones
Especialista en SQL Server

mant...@frenosa.com.pe
mant...@gmail.com
miguel_...@msn.com

Cel. 997914428

Microsoft Active Professional
Membresía FY11-4D8A908D4C470

extremo

unread,
Jun 16, 2011, 3:39:27 PM6/16/11
to Comunidad de Visual Foxpro en Español
enserio existe esto?

tendre que pegarme el tiro por la cabeza :(

Daniel Sánchez

unread,
Jun 17, 2011, 10:51:03 PM6/17/11
to publice...@googlegroups.com
El problema vendria cuando tu aplicación se bloquea y realmente necesitas terminarla, en ese escenario no podrías cerrar tu aplicación.

--
Daniel Sánchez Escobar
Investigación y Desarrollo
Reset Software & Sistemas
Móvil +051-949398047
Trujillo - Perú

hquinones

unread,
Jun 18, 2011, 11:29:53 AM6/18/11
to Comunidad de Visual Foxpro en Español
Solo por curiosidad, por que la necesidad de evitar que cierren el
programa, es un aplicativo de escritorio, o tratas de crear un virus
desde fox.

HQD

Miguel Antúnez

unread,
Jun 18, 2011, 11:33:50 AM6/18/11
to publice...@googlegroups.com
No es un virus, aunque lo parezca, la idea es que los usuarios no se queden mas del tiempo establecido en la empresa. 
ya que aquí en Perú te puede llegar una inspección laboral y te puede caer una multa si los usuarios siguen trabajando y no tienen horas extras aprobadas.
ya logre hacer que solo puedan iniciar sesión al servidor solo en su horario especifico, pero solo como inicio y no como fin. 
lo que quiero hacer es un aplicativo que saque de la red al final de su fin de labores, eso ya lo tengo, lo unico que me faltaria es que este aplicativo no lo puedan terminar proceso.

Saludos.
--
Miguel Angel Antúnez Camones
Especialista en SQL Server

hquinones

unread,
Jun 18, 2011, 11:50:06 AM6/18/11
to Comunidad de Visual Foxpro en Español
La otra alternativa seria, que desde mismo fox crees una tabla para
cada usuario en el que indiques la hora de inicio y fin, luego puedes
programar para que si esta fuera de rango cerrar la aplicación,
consultando con la hora del servidor

HQD


On 18 jun, 10:33, Miguel Antúnez <mantun...@gmail.com> wrote:
> No es un virus, aunque lo parezca, la idea es que los usuarios no se queden
> mas del tiempo establecido en la empresa.
> ya que aquí en Perú te puede llegar una inspección laboral y te puede caer
> una multa si los usuarios siguen trabajando y no tienen horas extras
> aprobadas.
> ya logre hacer que solo puedan iniciar sesión al servidor solo en su horario
> especifico, pero solo como inicio y no como fin.
> lo que quiero hacer es un aplicativo que saque de la red al final de su fin
> de labores, eso ya lo tengo, lo unico que me faltaria es que este aplicativo
> no lo puedan terminar proceso.
>
> Saludos.
>
> El 18 de junio de 2011 10:29, hquinones <hequ...@gmail.com> escribió:
>
>
>
>
>
> > Solo por curiosidad, por que la necesidad de evitar que cierren el
> > programa, es un aplicativo de escritorio, o tratas de crear un virus
> > desde fox.
>
> > HQD
>
> > On 17 jun, 21:51, Daniel Sánchez <resetsoftw...@gmail.com> wrote:
> > > El problema vendria cuando tu aplicación se bloquea y realmente necesitas
> > > terminarla, en ese escenario no podrías cerrar tu aplicación.
>
> > > --
> > > Daniel Sánchez Escobar
> > > Investigación y Desarrollo
> > > Reset Software & Sistemas
> > > Móvil +051-949398047
> > > Trujillo - Perú
>
> --
> Miguel Angel Antúnez Camones
> Especialista en SQL Server
>
> mantu...@frenosa.com.pe
> mantun...@gmail.com
> miguel_antu...@msn.com
> Cel. 997914428
>
> Microsoft Active Professional

Jairo Miranda

unread,
Jun 18, 2011, 12:22:56 PM6/18/11
to publice...@googlegroups.com
Esa es la idea de programar en un entorno multiusuario, por ahi baje un
programita completo que te puede servir , voy a ver como te lo pudo enviar
JM

-----Mensaje original-----
De: publice...@googlegroups.com
[mailto:publice...@googlegroups.com] En nombre de hquinones
Enviado el: Sábado, 18 de Junio de 2011 10:50


Para: Comunidad de Visual Foxpro en Español
Asunto: [vfp] Re: Evitar que se cierre programa desde el administrador de
tareas.

La otra alternativa seria, que desde mismo fox crees una tabla para

Jairo Miranda

unread,
Jun 18, 2011, 12:41:30 PM6/18/11
to publice...@googlegroups.com
Ahí va..

jm

-----Mensaje original-----
De: publice...@googlegroups.com


[mailto:publice...@googlegroups.com] En nombre de hquinones
Enviado el: Sábado, 18 de Junio de 2011 10:50

Para: Comunidad de Visual Foxpro en Español
Asunto: [vfp] Re: Evitar que se cierre programa desde el administrador de
tareas.

La otra alternativa seria, que desde mismo fox crees una tabla para

vf_EntornoMultiusuario.zip.txt

Miguel Antúnez

unread,
Jun 18, 2011, 1:09:27 PM6/18/11
to publice...@googlegroups.com
Por el tema del sistema no hay problema, ya esta hecho eso, el tema es que se quedan tal vez usando otro tipo de software, excel, correo, internet , etc. 

Walter R. Ojeda Valiente

unread,
Jun 18, 2011, 6:47:45 PM6/18/11
to publice...@googlegroups.com
Esa es una buena idea. Así no podrá usar el programa fuera de las horas especificadas, haga lo que haga.

Aunque por supuesto hay que controlar que no cambie la hora del Servidor si es que tiene acceso a él.

Saludos.

Walter.



> Date: Sat, 18 Jun 2011 08:50:06 -0700
> Subject: [vfp] Re: Evitar que se cierre programa desde el administrador de tareas.
> From: heq...@gmail.com
> To: publice...@googlegroups.com

Daniel Sánchez

unread,
Jun 18, 2011, 8:11:12 PM6/18/11
to publice...@googlegroups.com
Si no me equivoco a los usuarios validados dentro en un windows server se les puede indicar las horas que pueden estar conectados y si las pc se inician dentro de un dominio, al bloquear el usuario se cerrara su sesión de windows activa en ese momento y bloqueara la pc.


HOW TO: Limit User Logon Time in a Domain in Windows Server 2003

System TipThis article applies to a different version of Windows than the one you are using.Content in this article may not be relevant to you. Visit the Windows 7 Solution Center
For a Microsoft Windows 2000 version of this article, see 318714 .

On This Page

SUMMARY

This step-by-step article describes how to restrict the hours and days that a user may log on to a Windows Server 2003 domain. 

Change Logon Times for a User Account

You can set logon hours for a user account by using one of the following methods:
  • Edit the user account properties from the Active Directory directory service Users and Computers snap-in.
  • Edit the user account properties by using the net user command.

Method 1: Using the Active Directory Users and Computers Snap-in

  1. Start the Active Directory Users and Computers snap-in. To do this, click Start , point toAdministrative Tools , and then click Active Directory Users and Computers .
  2. In the console tree, click the container that contains the user account that you want.
  3. In the right pane, right-click the user account, and then click Properties .
  4. Click the Account tab, and then click Logon Hours .
  5. Click All to select all available times, and then click Logon Denied .
  6. Select the time blocks that you want to allow this user to log on to the domain, and then clickLogon Permitted . 

    A status line under the logon hours table displays the currently selected logon times. For example, Monday through Friday from 8 AM to 5 PM .
  7. When you are finished configuring logon hours, click OK , and then click OK in the user account Properties dialog box.
  8. Quit the Active Directory Users and Computers snap-in.

Method 2: Using the Net User Command-line Statement

  1. Click Start , and then click Run .
  2. In the Open box, type cmd , and then click OK .
  3. Type net user username /time: logon_times (where username is the name of the user account, and where logon_times are the days and times that you want to allow access to the domain), and then press ENTER. 

    Use the following information to help you use the /time switch:
    • Days can be spelled out (for example, Monday) or abbreviated (for example, M,T,W,Th,F,Sa,Su).
    • Hours can be in 12-hour notation (1PM or 1P.M.) or 24-hour notation (13:00).
    • A value of blank means that the user can never log on.
    • A value of all means that a user can always log on.
    • Use a hyphen ( - ) to mark a range of days or times. For example, to create a range from Monday through Friday, type either MF , or monday-friday . To create a range of time from 8:00 PM to 5:00 PM, type 8:00am-5:00pm , 8am-5pm , or 8:00-17:00.
    • Separate the day and time items with commas (for example, monday,8am-5pm).
    • Separate day and time units with semicolons (for example, monday,8am-5pm;tuesday,8am-4pm;wednesday,8am-3pm).
    • Do not use spaces between days or times.

Examples

The following examples show how to change the logon times for a specific user account.
  • To set John's logon time (8:00 AM to 5:00 PM) using 24-hour notation, type the following command, and then press ENTER:
    net user john /time:MF,08:00-17:00
  • To set John's logon time (8:00 AM to 5:00 PM) using 12-hour notation, type the following command, and then press ENTER:
    net user john /time:MF,8am-5pm
  • To specify logon hours of 4:00 AM until 5:00 PM on Monday, 1:00 PM until 3:00 PM on Tuesday, and 8:00 AM until 5:00 PM Wednesday through Friday for Mary, type the following command, and then press ENTER:
    net user mary /time:M,4am-5pm;T,1pm-3pm;WF,8:00-17:00

Change Logon Times for a Group of Users

You can use the net user command with the /time switch from the command-line or in a batch file to change logon times for a group of users in a domain. To do this, complete the "Step 1: Create a User Account List" and the "Step 2: Edit Logon Hours by Using the Net User Command" sections of this article. 

Step 1: Create a User Account List

  1. Start the Active Directory Users and Computers snap-in. To do this, click Start , point toPrograms , point to Administrative Tools , and then click Active Directory Users and Computers .
  2. In the console tree, click the organizational unit, or Users folder that contains the user accounts that you want.
  3. On the Action menu, click Export List .
  4. In the Save As dialog box, type the file name that you want in the File name box.
  5. In the Save as type list, click Text (Comma Delimited)(*.csv) , and then click Save .
  6. Edit the .csv file by using a text editor such as Notepad to remove entries where you do not want to apply the logon restrictions. The user accounts are listed under a heading with one account on each line. Also, you may have to edit the user names in this file so that they match the user account names that appear when you type Net User at a command prompt. 

    The following is an example of a this file:
      Name, Type, Description, Joe,User,, Sally,User,Account created for Sally, Betty,User,, Bob,, 

Step 2: Edit Logon Hours by Using the Net User Command

Use the net user command to apply logon restrictions to the accounts in the .csv file that you created in Step 1: Create a User Account List .
  1. Click Start , and then click Run .
  2. In the Open box, type cmd , and then click OK .
  3. Type the following command, where file_name is the name of the .csv file that contains the exported user accounts, and where logon_times are the days and times that you want to allow access to the domain:
    for/F "skip=1 tokens=1 delims=," %i in ( file_name .csv) do net user %i /time: logon_times
    This command is one line. It has been wrapped for readability. 

    Note In this command, there is a space between %i and /time .

Examples

The following examples show how to change the logon times for the user accounts in a .csv file that is named Exportusers.csv. 

Note The following commands are one line. They have been wrapped for readability.
  • To allow the users to log on to the server from 8:00 AM to 5:00 PM Monday through Friday, type the following command, and then press ENTER:
    for/F "skip=1 tokens=1 delims=," %i in (exportusers.csv) do net user %i /time:monday-friday,8am-5pm
  • To allow the users to log on to the server from 8:00 AM until 1:00 PM on Monday and Friday, and from 8:00 AM until 5:00 PM on Tuesday through Thursday, type the following command, and then press ENTER:
    for/F "skip=1 tokens=1 delims=," %i in (exportusers.csv) do net user %i /time:m,8:00AM-1:00PM;t-th,8:00AM-5:00PM;f,8:00AM-1:00PM
You can use this command in a batch file. However, you must add an additional percent (%) character to each variable. The following example code illustrates this:
  for/F "skip=1 tokens=1 delims=," %%i in (exportusers.csv) do net user %%i /time:m,8:00AM-1:00PM;t-th,8:00AM-5:00PM;f,8:00AM-1:00PM 
Note In this example, the command is one line. It has been wrapped for readability. 

Enforce Logon Time Restrictions Using Group Policy

You can use Group Policy to enforce the logon time restrictions that you apply. 

Step 1: Create a Group Policy object

To create a Group Policy object (GPO) that you use to enforce client logon restrictions:
  1. Start the Active Directory Users and Computers snap-in. To do this, click Start , point toPrograms , point to Administrative Tools , and then click Active Directory Users and Computers .
  2. In the console tree, right-click your domain or the organizational unit that contains the domain controllers that you want, and then click Properties .
  3. Click the Group Policy tab, and then click New .
  4. Type a name for this policy (for example, Account logon restrictions ), and then press ENTER.
  5. Click Properties , and then click the Security tab.
  6. Click to clear the Apply Group Policy check box for the security groups that you want to prevent from having this policy applied. Click to select the Apply Group Policy check box for the groups that you want to have this policy applied. When you are finished, click OK .

Step 2: Enforce Logon Hours Restrictions

  1. Start the Active Directory Users and Computers snap-in. To do this, click Start , point toPrograms , point to Administrative Tools , and then click Active Directory Users and Computers .
  2. In the console tree, right-click your domain or the organizational unit that contains the domain controller GPO that you want to edit, and then click Properties .
  3. Click the Group Policy tab, select the GPO that you want, and then click Edit .
  4. Under Computer Configuration , expand Windows Settings , expand Security Settings, expand Local Policies , and then click Security Options .
  5. In the right pane of the Group Policy snap-in, double-click Microsoft network server: Disconnect clients when logon hours expire .
  6. Click to select the Define this policy setting check box, click Enabled , and then click OK .
  7. Close the Group Policy snap-in, and then click OK .

Troubleshoot

Group Policy changes are not immediately enforced. Group Policy background processing can take up to 5 minutes to be refreshed on domain controllers, and up to 120 minutes to be refreshed on client computers. To force background processing of Group Policy settings, use the gpupdatecommand. 

Note secedit /refreshpolicy has been replaced with gpupdate . For more information about thegpupdate command, see Windows Server 2003 help. To do this, follow these steps:
  1. Click Start , and then click Run .
  2. In the Open box, type cmd , and then click OK .
  3. Type gpupdate , and then press ENTER.
  4. Type exit , and then press ENTER.
Seria lo mejor y más elegante y todo controlado por tu servidor, realizando las funciones para lo que fue creado.

Saludos

Luis Maria Guayan

unread,
Jun 19, 2011, 10:53:11 AM6/19/11
to publice...@googlegroups.com
Creo que esta es la mejor opción. Para que reinventar la rueda si el SO ya nos permite esa solución.

Luis María Guayán
Tucumán, Argentina
_________________________
http://www.PortalFox.com
Nada corre como un zorro
_________________________

Miguel Antúnez

unread,
Jun 20, 2011, 8:35:34 AM6/20/11
to publice...@googlegroups.com
antes había mencionado que esta parte ya la hacia. logre que solo tenga acceso el usuario en su horario indicado, contempla horas extras, vacaciones, etc.
pero lo que restringe es el inicio de sesión mas no cierra al termino. si el usuario se conecta y no sale de windows el active directory no le cierra.

ahora que leo bien esta opción dice inicio d sesión  mas no horario de labores.
image.png
Saludos.


 


2011/6/18 Daniel Sánchez <resets...@gmail.com>

--
Miguel Angel Antúnez Camones
Especialista en SQL Server

image.png

extremo

unread,
Jun 20, 2011, 9:09:05 AM6/20/11
to Comunidad de Visual Foxpro en Español
Bueno, hace un par de años atras recuerdo que en una empresa hubo un
gran problema con el tema de los horarios, los usuarios se quedaban
siempre mas tarde. Marcaban la hora de salida pero igual se quedaban
en la empresa, no presisamente a trabajar sino que a jugar en el pc ,
chatear y cosas por el estilo. El problema ocurrio cuando un dia
llegaron inspectores municipales despues del horario de trabajo y se
encontraron con la situación que habia muchos que estaban
"trabajando". Lo que empeoro las cosas fue que todos esos trabajadores
ya tenian marcada la hora de salida. Al ver la situaciòn los
trabajadores se aprovecharon y bueno pues dijeron que eso sucedia
todos los dias diciendo que trabajaban en vez de jugar, y la empresa
tuvo que pagar millonarias sumas de dinero a cada trabajador que habia
en la empresa segun la antiguedad de cada uno. Ahora esta empresa
tiene un estricto control se salida de los funcionarios, pues el
guardia tiene la facutad de sacar de la oficina a los empleados y
cortar la luz en algunos sectores de la empresa. Y los funcinarios que
no se vayan a la hora indicada por el contrato (exceptuando permisos
especiales por el jefe inmediato) puede ser causal de despido. Esa fue
una medida extrema pero hasta el dia de hoy les ha funcionado.

Bendiciones


On 20 jun, 08:35, Miguel Antúnez <mantun...@gmail.com> wrote:
> antes había mencionado que esta parte ya la hacia. logre que solo tenga
> acceso el usuario en su horario indicado, contempla horas extras,
> vacaciones, etc.
> pero lo que restringe es el inicio de sesión mas no cierra al termino. si el
> usuario se conecta y no sale de windows el active directory no le cierra.
>
> ahora que leo bien esta opción dice inicio d sesión  mas no horario de
> labores.
> [image: image.png]
> Saludos.
>
> 2011/6/18 Daniel Sánchez <resetsoftw...@gmail.com>
>
>
>
> > Si no me equivoco a los usuarios validados dentro en un windows server se
> > les puede indicar las horas que pueden estar conectados y si las pc se
> > inician dentro de un dominio, al bloquear el usuario se cerrara su sesión de
> > windows activa en ese momento y bloqueara la pc.
>
> >http://support.microsoft.com/kb/816666
>
> > HOW TO: Limit User Logon Time in a Domain in Windows Server 2003
> > View products that this article applies to.<http://translate.googleusercontent.com/translate_c?anno=2&hl=es&rurl=...>
> >   System TipThis article applies to a different version of Windows than
> > the one you are using.Content in this article may not be relevant to you. Visit
> > the Windows 7 Solution Center<http://translate.googleusercontent.com/translate_c?anno=2&hl=es&rurl=...>
> >  For a Microsoft Windows 2000 version of this article, see 318714<http://translate.googleusercontent.com/translate_c?anno=2&hl=es&rurl=...>
> >  .
> >  On This Page<http://translate.googleusercontent.com/translate_c?anno=2&hl=es&rurl=...>
> > SUMMARY<http://translate.googleusercontent.com/translate_c?anno=2&hl=es&rurl=...>
> > This step-by-step article describes how to restrict the hours and days that
> > a user may log on to a Windows Server 2003 domain.
>
> > <http://translate.googleusercontent.com/translate_c?anno=2&hl=es&rurl=...>
> >  Back to the top<http://translate.googleusercontent.com/translate_c?anno=2&hl=es&rurl=...>
> > Change Logon Times for a User Account You can set logon hours for a user
> > account by using one of the following methods:
>
> >    - Edit the user account properties from the Active Directory directory
> >    service Users and Computers snap-in.
> >    - Edit the user account properties by using the *net user* command.
>
> > Method 1: Using the Active Directory Users and Computers Snap-in
>
> >    1. Start the Active Directory Users and Computers snap-in. To do this,
> >    click *Start* , point to*Administrative Tools* , and then click *Active
> >    Directory Users and Computers* .
> >    2. In the console tree, click the container that contains the user
> >    account that you want.
> >    3. In the right pane, right-click the user account, and then click *
> >    Properties* .
> >    4. Click the *Account* tab, and then click *Logon Hours* .
> >    5. Click *All* to select all available times, and then click *Logon
> >    Denied* .
> >    6. Select the time blocks that you want to allow this user to log on to
> >    the domain, and then click*Logon Permitted* .
>
> >    A status line under the logon hours table displays the currently
> >    selected logon times. For example, *Monday through Friday from 8 AM to
> >    5 PM* .
> >    7. When you are finished configuring logon hours, click *OK* , and then
> >    click *OK* in the *user account Properties* dialog box.
> >    8. Quit the Active Directory Users and Computers snap-in.
>
> > Method 2: Using the Net User Command-line Statement
>
> >    1. Click *Start* , and then click *Run* .
> >    2. In the *Open* box, type cmd , and then click *OK* .
> >    3. Type net user username /time: logon_times (where username is the
> >    name of the user account, and where logon_times are the days and times
> >    that you want to allow access to the domain), and then press ENTER.
>
> >    Use the following information to help you use the */time* switch:
> >       - Days can be spelled out (for example, Monday) or abbreviated (for
> >       example, M,T,W,Th,F,Sa,Su).
> >       - Hours can be in 12-hour notation (1PM or 1P.M.) or 24-hour
> >       notation (13:00).
> >       - A value of blank means that the user can never log on.
> >       - A value of *all* means that a user can always log on.
> >       - Use a hyphen ( *-* ) to mark a range of days or times. For
> >       example, to create a range from Monday through Friday, type either
> >       MF , or monday-friday . To create a range of time from 8:00 PM to
> >       5:00 PM, type 8:00am-5:00pm , 8am-5pm , or 8:00-17:00.
> >       - Separate the day and time items with commas (for example,
> >       monday,8am-5pm).
> >       - Separate day and time units with semicolons (for example,
> >       monday,8am-5pm;tuesday,8am-4pm;wednesday,8am-3pm).
> >       - Do not use spaces between days or times.
>
> > ExamplesThe following examples show how to change the logon times for a
> > specific user account.
>
> >    - To set John's logon time (8:00 AM to 5:00 PM) using 24-hour notation,
> >    type the following command, and then press ENTER:
> >    net user john /time:MF,08:00-17:00
> >    - To set John's logon time (8:00 AM to 5:00 PM) using 12-hour notation,
> >    type the following command, and then press ENTER:
> >    net user john /time:MF,8am-5pm
> >    - To specify logon hours of 4:00 AM until 5:00 PM on Monday, 1:00 PM
> >    until 3:00 PM on Tuesday, and 8:00 AM until 5:00 PM Wednesday through Friday
> >    for Mary, type the following command, and then press ENTER:
> >    net user mary /time:M,4am-5pm;T,1pm-3pm;WF,8:00-17:00
>
> > <http://translate.googleusercontent.com/translate_c?anno=2&hl=es&rurl=...>
> >  Back to the top<http://translate.googleusercontent.com/translate_c?anno=2&hl=es&rurl=...>
> > Change Logon Times for a Group of Users You can use the *net user* command
> > with the */time* switch from the command-line or in a batch file to change
> > logon times for a group of users in a domain. To do this, complete the
> > "Step 1: Create a User Account List" and the "Step 2: Edit Logon Hours by
> > Using the Net User Command" sections of this article.
>
> > Step 1: Create a User Account List
>
> >    1. Start the Active Directory Users and Computers snap-in. To do this,
> >    click *Start* , point to*Programs* , point to *Administrative Tools* ,
> >    and then click *Active Directory Users and Computers* .
> >    2. In the console tree, click the organizational unit, or *Users* folder
> >    that contains the user accounts that you want.
> >    3. On the *Action* menu, click *Export List* .
> >    4. In the *Save As* dialog box, type the file name that you want in
> >    the *File name* box.
> >    5. In the *Save as type* list, click *Text (Comma Delimited)(*.csv)* ,
> >    and then click *Save* .
> >    6. Edit the .csv file by using a text editor such as Notepad to remove
> >    entries where you do not want to apply the logon restrictions. The user
> >    accounts are listed under a heading with one account on each line. Also,
> >    you may have to edit the user names in this file so that they match the user
> >    account names that appear when you type Net User at a command prompt.
>
> >    The following is an example of a this file:
>
> >      Name, Type, Description, Joe,User,, Sally,User,Account created for Sally, Betty,User,, Bob,,
>
> > Step 2: Edit Logon Hours by Using the Net User CommandUse the *net user* command
> > to apply logon restrictions to the accounts in the .csv file that you
> > created in Step 1: Create a User Account List<http://translate.googleusercontent.com/translate_c?anno=2&hl=es&rurl=...>
> >  .
>
> >    1. Click *Start* , and then click *Run* .
> >    2. In the *Open* box, type cmd , and then click *OK* .
> >    3. Type the following command, where file_name is the name of the .csv
> >    file that contains the exported user accounts, and where logon_times are
> >    the days and times that you want to allow access to the domain:
> >    for/F "skip=1 tokens=1 delims=," %i in ( *file_name* .csv) do net user
> >    %i /time: *logon_times*
> >    This command is one line. It has been wrapped for readability.
>
> >    *Note* In this command, there is a space between *%i* and */time* .
>
> > ExamplesThe following examples show how to change the logon times for the
> > user accounts in a .csv file that is named Exportusers.csv.
>
> > *Note* The following commands are one line. They have been wrapped for
> > readability.
>
> >    - To allow the users to log on to the server from 8:00 AM to 5:00 PM
> >    Monday through Friday, type the following command, and then press ENTER:
> >    for/F "skip=1 tokens=1 delims=," %i in (exportusers.csv) do net user %i
> >    /time:monday-friday,8am-5pm
> >    - To allow the users to log on to the server from 8:00 AM until 1:00 PM
> >    on Monday and Friday, and from 8:00 AM until 5:00 PM on Tuesday through
> >    Thursday, type the following command, and then press ENTER:
> >    for/F "skip=1 tokens=1 delims=," %i in (exportusers.csv) do net user %i
>
> ...
>
> leer más »
>
>  image.png
> 14 KVerDescargar- Ocultar texto de la cita -

Miguel Antúnez

unread,
Jun 20, 2011, 10:59:27 AM6/20/11
to publice...@googlegroups.com
Eso estábamos analizando, ya que tenemos aparte del control de marcaciones un control de acceso en la puerta de la empresa. 
habrá que sacarle un reporte al vigilante al fin de cada jornada que personas no han salido de la empresa y no deberían estar para que los busque y los  pueda retirar de la empresa.

Saludos.

Daniel Sánchez

unread,
Jun 20, 2011, 11:30:06 AM6/20/11
to publice...@googlegroups.com
Es un problema cuando el personal es muy trabajador y de seguro están peleados en su casa, jejejeejeje.

Juan de Dios Corrales Leal

unread,
Jun 23, 2011, 7:56:31 PM6/23/11
to Comunidad de Visual Foxpro en Español
pues creo que esto es lo que buscas, y creo que alguien se tendra que
dar un tiro por que casi casi lo prometio....

Solo hay un detalle, esta en otro lenguaje (creo que VB6 o VB.NET) y
tendria que traducirlo, asi que la pregunta es... quien sera el
valiente que lo haga...???

Cito desde la pagina donde lo encontre:

Public Function MakeCritical(Phandle As Long, Value As Boolean)

'si le asignas verdadero sera un proceso critico y para revertirlo
llama a la funcion con el valor false. 'es un muy buen uso del API
NtSetInformationProcess, puedes hacer un hook al cierre del sistema
para 'hacer que tu proceso se vuelva No Critico al cierre de windows.

Option Explicit
Private Const ANYSIZE_ARRAY = 1
Private Const TOKEN_ADJUST_PRIVILEGES = &H20
Private Const TOKEN_QUERY = &H8
Private Const SE_PRIVILEGE_ENABLED = &H2

Private Type LUID
LowPart As Long
HighPart As Long
End Type

Private Type LUID_AND_ATTRIBUTES
pLuid As LUID
Attributes As Long
End Type

Private Type TOKEN_PRIVILEGES
PrivilegeCount As Long
Privileges(ANYSIZE_ARRAY) As LUID_AND_ATTRIBUTES
End Type

Private Declare Function AdjustTokenPrivileges Lib
"advapi32.dll" (ByVal TokenHandle As Long, ByVal DisableAllPrivileges
As Long, NewState As TOKEN_PRIVILEGES, ByVal BufferLength As Long,
PreviousState As TOKEN_PRIVILEGES, ReturnLength As Long) As Long
Private Declare Function LookupPrivilegeValue Lib "advapi32" Alias
"LookupPrivilegeValueA" (ByVal lpSystemName As String, ByVal lpName As
String, lpLUID As LUID) As Long
Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
Private Declare Function OpenProcessToken Lib "advapi32.dll" (ByVal
ProcessHandle As Long, ByVal DesiredAccess As Long, TokenHandle As
Long) As Long

Public Const SE_CREATE_TOKEN_NAME As String = "SeCreateTokenPrivilege"
Public Const SE_ASSIGNPRIMARYTOKEN_NAME As String =
"SeAssignPrimaryTokenPrivilege"
Public Const SE_LOCK_MEMORY_NAME As String = "SeLockMemoryPrivilege"
Public Const SE_INCREASE_QUOTA_NAME As String =
"SeIncreaseQuotaPrivilege"
Public Const SE_UNSOLICITED_INPUT_NAME As String =
"SeUnsolicitedInputPrivilege"
Public Const SE_MACHINE_ACCOUNT_NAME As String =
"SeMachineAccountPrivilege"
Public Const SE_TCB_NAME As String = "SeTcbPrivilege"
Public Const SE_SECURITY_NAME As String = "SeSecurityPrivilege"
Public Const SE_TAKE_OWNERSHIP_NAME As String =
"SeTakeOwnershipPrivilege"
Public Const SE_LOAD_DRIVER_NAME As String = "SeLoadDriverPrivilege"
Public Const SE_SYSTEM_PROFILE_NAME As String =
"SeSystemProfilePrivilege"
Public Const SE_SYSTEMTIME_NAME As String = "SeSystemtimePrivilege"
Public Const SE_PROF_SINGLE_PROCESS_NAME As String =
"SeProfileSingleProcessPrivilege"
Public Const SE_INC_BASE_PRIORITY_NAME As String =
"SeIncreaseBasePriorityPrivilege"
Public Const SE_CREATE_PAGEFILE_NAME As String =
"SeCreatePagefilePrivilege"
Public Const SE_CREATE_PERMANENT_NAME As String =
"SeCreatePermanentPrivilege"
Public Const SE_BACKUP_NAME As String = "SeBackupPrivilege"
Public Const SE_RESTORE_NAME As String = "SeRestorePrivilege"
Public Const SE_SHUTDOWN_NAME As String = "SeShutdownPrivilege"
Public Const SE_DEBUG_NAME As String = "SeDebugPrivilege"
Public Const SE_AUDIT_NAME As String = "SeAuditPrivilege"
Public Const SE_SYSTEM_ENVIRONMENT_NAME As String =
"SeSystemEnvironmentPrivilege"
Public Const SE_CHANGE_NOTIFY_NAME As String =
"SeChangeNotifyPrivilege"
Public Const SE_REMOTE_SHUTDOWN_NAME As String =
"SeRemoteShutdownPrivilege"
'THE api we need!

Private Declare Function NtSetInformationProcess Lib
"ntdll.dll" (ByVal hProcess As Integer, ByVal ProcessInformationClass
As Integer, ByVal ProcessInformation As Long, ByVal
ProcessInformationLength As Integer) As Integer
Private Const ProcessBreakOnTermination As Long = 29
'The api we need!
Public Function MakeCritical(Phandle As Long, Value As Boolean)
GetPrivilegs SE_DEBUG_NAME
Dim ProcessInfo As Long

If Value = True Then
ProcessInfo = 29&
Else
ProcessInfo = 0&
End If

Call NtSetInformationProcess(Phandle, ProcessBreakOnTermination,
VarPtr(ProcessInfo), Len(ProcessInfo))
End Function
Public Function GetPrivilegs(ByVal privilegio As String) As Long

Dim lpLUID As LUID
Dim lpToken As TOKEN_PRIVILEGES
Dim lpAntToken As TOKEN_PRIVILEGES
Dim hToken As Long
Dim hProcess As Long
Dim res As Long

hProcess = GetCurrentProcess()
res = OpenProcessToken(hProcess, TOKEN_ADJUST_PRIVILEGES Or
TOKEN_QUERY, hToken)
If res = 0 Then
Exit Function
End If
res = LookupPrivilegeValue(vbNullString, privilegio, lpLUID)
If res = 0 Then
Exit Function
End If
With lpToken
.PrivilegeCount = 1
.Privileges(0).Attributes = SE_PRIVILEGE_ENABLED
.Privileges(0).pLuid = lpLUID
End With

res = AdjustTokenPrivileges(hToken, False, lpToken, Len(lpToken),
lpAntToken, Len(lpAntToken))
If res = 0 Then
Exit Function
End If
GetPrivilegs = res
End Function

QUIEN DIJO YO???

On Jun 16, 12:24 pm, Miguel Antúnez <mantun...@gmail.com> wrote:
> Buenas Tardes.
> Quisiera saber como hacer lo indicado, evitar que con el administrador de
> tareas me cierren mi programa en ejecución.
>
> Saludos.
>
> --
> Miguel Angel Antúnez Camones
> Especialista en SQL Server
>
> mantu...@frenosa.com.pe
> mantun...@gmail.com
> miguel_antu...@msn.com
Reply all
Reply to author
Forward
0 new messages