martes, 10 de abril de 2012

Reinicio de equipo por comandos

C:\Windows\system32\shutdown.exe /r /f /t 10

Script para modificacion informacion usuarios del dominio


'**************************************************************************
'*Script para modificacion informacion usuarios del dominio
'**************************************************************************
On error resume next

Const Enabled = 1
Const Disabled = 0
Const ForReading = 1
Const ForWrite = 2
Dim fso, f, Msg, pass, minusculas



'abre fichero
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\temp\users.xls")

intRow = 1

'lee fichero
Do Until objExcel.Cells(intRow,1).Value = "FINALTEXTO"

cn1 = objExcel.Cells(intRow, 1).Value
cn2 = objExcel.Cells(intRow, 9).Value
cn3 = objExcel.Cells(intRow, 10).Value

'wscript.echo cn1
'wscript.echo cn2
'wscript.echo cn3
'modifica campo usuario descripcion

Set objOU = GetObject("LDAP://"+cn1)
objOU.description = cn2
objOU.extensionAttribute1 = cn3
objOU.setInfo

'modifica campo usuario extensionAttribute1
'Set objOU2 = GetObject("LDAP://"+cn1)
'objOU2.extensionAttribute1 = cn3
'obj.OU.setInfo

intRow = intRow + 1

on error resume next

loop

objExcel.Quit

martes, 3 de abril de 2012

Crear archivos war

Para crear un archivo web desplegable como aplicación web en un servidor, debes, utilizando la terminal de Windows (Inicio + Ejecutar + cmd) navegar hasta donde esté la carpeta raiz de tu aplicación (por ejemplo C:\servers\tomcat\webapps) y luego lanzar el siguiente comando:

jar cvf mifichero.war nombre_carpeta_aplicacion


en mi caso, por ejemplo la instrucción queda de la siguiente manera:

jar cvf liferay-portal.war ROOT

El archivo .war generado en la misma carpeta ya está disponible para desplegar en el servidor (pegándolo en la carpeta webapps del Tomcat y reiniciando, si usas Tomcat)

Habilitar log mysql

http://serverfault.com/questions/71071/how-to-enable-mysql-logging

lunes, 2 de abril de 2012

Reset password fortinet


  1. Connect to the firewall via the Console port on the back of the unit. This is done either by an Seriel cable or a RJ-45 to Seriel cabel.
  2. Start HyperTrm.exe (Hyber Terminal)
  3. Connect to the firewall using the following parameter
    1. Baud 9600
    2. 8Bit
    3. None
    4. 1
    5. None
    6. And of course the correct com-port. Yeah I know, obvious... but many make this mistake
  4. The firewall should then repose with its name or hostname. (If it dont try pressing "enter")
  5. Type in the username: maintainer
  6. The password is bcpb + The serienumber of the firewall (remember CAPS letters)
    1. Note that on some devices, after the device boots, you have 14 seconds to type in the username and password. It might, therefore, be necessary to have them ready in a text editor, and then copy and paste them into the login screen.
  7. Now you should be connected to the firewall, and to change the admin password you type the following.
    1. config system admin
    2. edit admin
    3. set password <psswrd>
    4. end
  8. Now you are all done. Enjoy your regained acces to the Firewall.

Actualizacion a sharepoint 2010

Pasos para actualizar a SP 2010:

-Actualizar bbdd de contenido
-Restaurar la bbdd
-Crear aplicación web y añadir contenido:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN>stsadm -o addcontentdb -databasename Intranet -url http://srvsp:100
-desasociar la bbdd
-crear una aplicación y asignarle la bbdd actualizada

Mas información en:
http://technet.microsoft.com/es-es/library/cc287628.aspx
http://technet.microsoft.com/en-us/library/ee947140.aspx
http://blogs.technet.com/b/tothesharepoint/archive/2010/07/19/upgrade-to-sharepoint-server-2010-from-other-versions-or-products.aspx
http://technet.microsoft.com/es-es/library/cc303309.aspx
http://sharepoint.microsoft.com/blog/Pages/BlogPost.aspx?PageType=4&ListId={72C1C85B-1D2D-4A4A-90DE-CA74A7808184}&pID=441