Autor: Daniel Davila Lopez

Daniel Davila Lopez

Exchange, Búsqueda de mails

Búsqueda a través de todos los buzones

Analizaremos termino por termino de la consulta

Búsqueda en los buzones «Get-Mailbox»
Termino para que la búsqueda sea ilimitada » -ResultSize unlimited», por default solo busca las primeras 1000 coincidencias
Consulta «-SearchQuery» ‘Subject:xxxxxxxx’, donde xxxxxxxx es el titulo del mail que búscamos, si se omite Subject: se buscara también el texto dentro del cuerpo del correo.
Buzón donde depositara la consulta y las coincidencias de la misma: -TargetMailbox
Carpeta donde depositara la consulta y las coincidencias (se puede omitir): -TargetFolder
Parámetro para indicar que las coincidencias deben ser borradas: -DeleteContent

--
Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery 'Subject:COMP. DE PAGO FACT. 60% PEDIDO 578799758' -TargetMailbox ddavila@momentoexacto.com -TargetFolder "BusquedaFolder"  -DeleteContent
--

 

MSSQL, Configurar XP_CMDSHELL

Script para habilitar y deshabilitar la funcion de xp_cmdshell

 

-- To allow advanced options to be changed.
EXECUTE sp_configure 'show advanced options', 1;
GO
-- To update the currently configured value for advanced options.
RECONFIGURE;
GO
-- To enable the feature.
EXECUTE sp_configure 'xp_cmdshell', 1;
GO
-- To update the currently configured value for this feature.
RECONFIGURE;
GO

--*******************DESHABILITAR*************************

-- To enable the feature.
EXECUTE sp_configure 'xp_cmdshell', 0;
GO
-- To update the currently configured value for this feature.
RECONFIGURE;
GO
-- To allow advanced options to be changed.
EXECUTE sp_configure 'show advanced options', 0;
GO
RECONFIGURE;
GO

 

-- To allow advanced options to be changed.
EXEC sp_xp_cmdshell_proxy_account 'domain\user1','users1 Windows password' EXEC sp_xp_cmdshell_proxy_account 'domain\user2','users2 Windows password'

Aplicar permisos para que pueda ejecutar cmdshell

GRANT EXECUTE ON xp_cmdshell TO [BATTA-NET\User]

Verificar si esta habilitado xp_cmdschell

 
Use master
EXEC SP_CONFIGURE 'xp_cmdshell';

Lista de usuarios con permisos

 
--usuarios que tienen habiilitado
Use master
EXEC sp_helprotect 'xp_cmdshell'

Sophos, desinistalar

En ocasiones hay que agregar algunos registros en el REGEDIT para poder desinstalar

--
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SAVService" /t REG_DWORD /v Start /d 0x00000004 /f
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Sophos MCS Agent" /t REG_DWORD /v Start /d 0x00000004 /f
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Sophos Endpoint Defense\TamperProtection\Config" /t REG_DWORD /v SAVEnabled /d 0 /f
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Sophos Endpoint Defense\TamperProtection\Config" /t REG_DWORD /v SEDEnabled /d 0 /f
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Sophos\SAVService\TamperProtection" /t REG_DWORD /v Enabled /d 0 /f
--