Volver 3DG > Informática y Tecnología > Software
Registrarse FAQ Listar Miembros

Software >  

Para los que tuvieron problemas con el NO cambio de hora

Participa en el tema Para los que tuvieron problemas con el NO cambio de hora en el foro Software




Discusión cerrada
 
LinkBack Herramientas Modo de visualización
Viejo 19-10-09, 11:20 AM   #1
Disaster
 
Avatar de The-Loko
 
Registración: Jun 2003
Mensajes: 2,232
Para los que tuvieron problemas con el NO cambio de hora

Hola muchachada! traigo una solucion para aquellos que, al igual que yo, administren algun dominio, y hayan tenido problemas con el NO cambio de horario (como todos sabemos, los equipos tenian configurada la zona horaria de Buenos Aires con el DST)

Aclaro, esto es para aplicarlo en dominios con active directory, donde podemos pasar un script de inicio de sesion a todos los equipos mediante una GPO.

Los pasos son simples:

Primero:
Crear un archivo "TZUpdate.reg" con el siguiente codigo:

Código:
Windows Registry Editor Version 5.00


[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Argentina Standard Time]

"Display"="(GMT-03:00) Buenos Aires"

"Dlt"=""

"Std"="Argentina Standard Time"

"TZI"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,\

  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00


[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Argentina Standard Time\Dynamic DST]

"FirstEntry"=dword:000007d6

"LastEntry"=dword:000007d8

"2008"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,03,00,00,00,03,00,00,00,\

  00,00,00,00,00,00,00,00,0c,00,00,00,05,00,00,00,00,00,00,00,00,00

"2007"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,01,00,01,00,01,00,00,00,\

  00,00,00,00,00,00,00,00,0c,00,00,00,05,00,00,00,00,00,00,00,00,00

"2006"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,\

  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

Luego, crear un vbs "RefreshTZInfo.vbs" con el siguiente codigo:

Código:
Set objSh = CreateObject("WScript.Shell")

 

'Get the StandardName key of the current time zone

szStandardName = objSh.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\StandardName")

 

'Enumerate the subkeys in the time zone database

const HKEY_LOCAL_MACHINE = &H80000002

Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")

szTzsKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones"

objReg.EnumKey HKEY_LOCAL_MACHINE, szTzsKeyPath, arrTzSubKeys

 

'Step through the time zones to find the matching Standard Name

szTzKey = "<Unknown>"

For Each subkey In arrTzSubKeys

    If (objSh.RegRead("HKLM\" & szTzsKeyPath & "\" & subkey & "\Std") = szStandardName) Then

        'Found matching StandardName, now store this time zone key name

        szTzKey = subkey

    End If

Next

 

If szTzKey = "<Unknown>" Then

       'Write entry to the Application event log stating that the update has failed to execute

       objSh.LogEvent 1, "DST 2007 Registry Update and Refresh failed to execute on this computer.  Time zones failed to enumerate properly or matching time zone not found."

       Wscript.Quit 0

End If

 

Dim process, processid, result, strUpdateCommand

Set process = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2:Win32_process")

 

'Add time change privilege to the process object

process.Security_.Privileges.AddAsString "SeSystemTimePrivilege",True

strUpdateCommand = "control.exe timedate.cpl,,/Z" & szTzKey

 

'Launch control.exe to refresh time zone information using the TZ key name obtained above

result = process.create(strUpdateCommand,Null,Null,processid)

If result <> 0 Then

          objSh.LogEvent 1, "DST 2007 Registry Update and Refresh failed to execute on this computer.  Unable to refresh the Timezone database."

    Wscript.Quit 0

End If

 

'Get current display name of refreshed time zone

szCurrDispName = objSh.RegRead("HKLM\" & szTzsKeyPath & "\" & szTzKey & "\Display")

 

'Write entry to the Application event log stating that the update has executed

objSh.LogEvent 4, "DST 2007 Registry Update and Refresh h]as been executed on this computer." & chr(13) & chr(10) & chr(13) & chr(10) & "Current time zone is: " & szCurrDispName & "."
Por ultimo, crear un .bat o .cmd con el siguiente codigo:

Código:
@echo off
regedit /s \\contoso.com\NETLOGON\TZupdate.reg
cscript \\contoso.com\NETLOGON\refreshTZinfo.vbs
Por supuesto, cambiar el dominio \\contoso.com por el de nuestro dominio.

Si quieren hacerlo para un entorno pequenio (un cyber digamos).
Lo unico que haria falta hacer, es importar el .reg, y luego correr el script en visual.
Solo sirve si los equipos tienen configurada la zona horaria de bs as.


Saludos y espero que les sea de utilidad!
__________________
Un Pingüino En Córdoba
The-Loko está desconectado  
Viejo 19-10-09, 01:35 PM   #2
emptybox IT
 
Avatar de excite
 
Registración: Oct 2007
Ubicación: Neuquen Capital
Mensajes: 3,258
Re: Para los que tuvieron problemas con el NO cambio de hora

Yo no tuve problemas con nada, que raro, recien se me chingó la hora de Windows7 si, pero se solucionó simple.
__________________
Emptybox IT
excite está desconectado  
Viejo 19-10-09, 10:12 PM   #3
X
 
Avatar de slim shady
 
Registración: Apr 2003
Ubicación: Dark side of the moon
Mensajes: 5,578
Re: Para los que tuvieron problemas con el NO cambio de hora

En mi laburo viejo se debe haber cambiado la hora en todo el dominio, jaja.

Agradezco administrar servidores no argentinos
slim shady está desconectado  
Viejo 20-10-09, 02:28 AM   #4
Totalmente fumado
 
Avatar de -Agustinos-
 
Registración: Oct 2007
Ubicación: en mi casa
Mensajes: 3,819
Re: Para los que tuvieron problemas con el NO cambio de hora

muy buen aporte
__________________
C2Q Q6600@3.0Ghz/ EVGA 780I SLI 132-CK-NF78/Gskill PI Black 2x2 Gb Pc 8500
750Gb Samsung SataII 32Mb/ GTS250 Core Edition XFX /Silencer 750 Quad (Blue)
Gabinete PowerCooler pulsar/Dvd-rw Samsumg-Toshiba 20x/ Dvd-rw lg/ Viewsonic VA2016/ Logitech Wave/ Cordless Rumblepad 2
Nokia 5800XM
-Agustinos- está conectado  
No leído 01-08-10, 04:26 AM  
Tema Cerrado
 
Mensajes: n/a
Tema Cerrado Automáticamente

Este tema se cerró automáticamente porque no tuvo actividad en los últimos meses. Los mensajes que contiene pueden no reflejar las opiniones actuales de sus autores o pertenecer a usuarios no activos.

Si tenés alguna inquietud relacionada con este tema, por favor abrí un nuevo tema y hacé referencia a éste dejando el enlace en tu primer post.
 


Discusión cerrada


Herramientas
Modo de visualización



Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
Copyright 1999-2010 3DG - Desarollado por 3DGLabs