tag:blogger.com,1999:blog-51686620253435327432024-03-13T09:45:11.849-07:00Compartir TecnologíaUnknownnoreply@blogger.comBlogger8125tag:blogger.com,1999:blog-5168662025343532743.post-61205116434916772852012-09-25T03:39:00.000-07:002012-09-25T03:39:03.714-07:00Lync 2010: No se pudo realizar una operación de Active Directory He estado esta mañana levantando un servidor de Lync 2010 y al dar de alta los usuarios me aparecía un error muy feo que venia a decirme:<br />
No se pudo realizar una operación de Active Directory en "****.***". No se puede repetir la operación "Los derechos de acceso son onsuficientes para realizar la operación" 00002098: SecErr: DSID-03150BC1, problem 4003 (INSUFF_ACCESS_RIGHTS), data 0"<br />
<br />
Al parecer suele pasar con los usuarios del grupo de administradores, la solución muy simple.<br />
Vamos a la consola del directorio activo y habilitamos las características avanzadas en el menú "VER"<br />
En el usuario que nos falle entramos en la pestaña seguridad y en Opciones Avanzadas habilitamos el botón de permitir herencia.<br />
<br />
Probadlo y me contáis .<br />
Un Saludo.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-5168662025343532743.post-31400714496122582682012-09-11T23:59:00.001-07:002012-09-11T23:59:48.055-07:00Cisco VPN:"failed to enable virtual adapter" en Windows 8Buenos días.<br />
Como buen probador de Windows 8 ( Con el que estoy bastante satisfecho) , hoy me he encontrado con un problema al intentar instalar el cliente VPN de Cisco . Al intentar levantar una conexión me aparecía un error muy feo.<br />
<br />
"failed to enable virtual adapter"<br />
<br />
Me he puesto a investigar un poco ,por si era un problema de compatibilidad con el sistema operativo y he encontrado una solución muy simple.<br />
<br />
Paso 1:<br />
Abrir REGEDIT<br />
<br />
-Pulsamos Win+R o buscamos el botón de ejecutar.<br />
-Escribimos REGEDIT<br />
<br />
Paso 2:<br />
<br />
Buscamos la entrada <br />
<br />
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CVirtA y en la entrada <br />
"Display Name" tenemos que cambiar su valor.<br />
<br />
<li>Para 32 bits, "Cisco Systems VPN Adapter”</li>
<li>Para 64 bits,"Cisco Systems VPN Adapter for 64-bit Windows"</li>
<br />
Y listo, no hace falta ni reiniciar el cliente ni el equipo.<br />
<br />
Espero que os sircaUnknownnoreply@blogger.com1tag:blogger.com,1999:blog-5168662025343532743.post-74381504128041596542011-05-24T00:20:00.000-07:002011-05-24T00:20:41.955-07:00No se puede cargar el archivo C:\Fichero.ps1 porque en el sistema está deshabilitada la ejecución de scripts.Buenos Días de nuevo.<o:p></o:p><br />
<br />
Intentando programar unas tareas de Powershell en unos servidores nuevos me<br />
ha aparecido el siguiente mensaje de error. <o:p></o:p><br />
<br />
No se puede cargar el archivo C:\Fichero.ps1 porque en el sistema está<br />
deshabilitada la ejecución de scripts. Vea “get-help about_signing” para<br />
obtener más información.<o:p></o:p><br />
<br />
Y la verdad es que no me acordaba del significado, parece trivial, pero la<br />
memoria a veces falla.<o:p></o:p><br />
<br />
Por defecto la ejecución de scripts viene deshabilitada en Windows 2008, por<br />
motivos de seguridad, así que os voy a dar la receta para solucionarlo.<o:p></o:p><br />
<br />
Abrimos Powershell como "administrador" (Muy importante porque<br />
vamos a tocar claves de registro).<o:p></o:p><br />
<br />
Ejecutamos Get-ExecutionPolicy<o:p></o:p><br />
<br />
Si nos devuelve Restricted, este es nuestro problema.<o:p></o:p><br />
<br />
Ejecutamos:<o:p></o:p><br />
<br />
Set-ExecutionPolicy Unrestricted<o:p></o:p><br />
<br />
Y ya lo tendríamos habilitado.<o:p></o:p><br />
<br />
Volvemos a ejecutar Get-ExecutionPolicy y nos debería devolver Unrestricted.<o:p></o:p><br />
<br />
Ya tenemos habilitada la ejecución de Scripts.<o:p></o:p><br />
<br />
Un Saludo<o:p></o:p><br />
<br />
<br />
<br />
<div style="text-align: justify;"><strong></strong><em></em><strong></strong><strong></strong><em></em><em><strong></strong></em></div>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-5168662025343532743.post-75904049057338620972011-05-23T06:36:00.000-07:002011-05-23T06:36:23.507-07:00Listar ficheros y tamaños de SQL SERVERBuenas Tardes a todos , <br />
Os voy a compartir un procedimiento almacenado que lista todos los ficheros de todas las bases de datos que tenemos y nos dirá su tamaño y su nivel de ocupación.<br />
<br />
Es relativamente simple utilizando el comando sp_msforeachdb , pero me ha parecido interesante compartirlo con todos vosotros.<br />
<br />
Lo dejará en una tabla en tempdb llamada ocupacion que podremos consultar.<br />
<br />
<span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;">SET ANSI_NULLS<span style="font-size: x-small;"> </span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;">ON</span></span></span></span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;">GO</span></span><br />
<span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;"><br />
SET QUOTED_IDENTIFIER<span style="font-size: x-small;"> </span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;">ON</span></span></span></span><br />
<span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;">GO<br />
<br />
CREATE <span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;">PROCEDURE</span></span><span style="font-size: x-small;"> </span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">[dbo]</span></span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">.</span></span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">[ocupacions]</span></span><span style="font-size: x-small;"> </span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;">as</span></span><span style="font-size: x-small;"> </span></span></span><span style="font-size: x-small;"><br />
</span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;">IF <span style="color: grey;">EXISTS</span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;"> </span></span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">(</span></span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;">SELECT</span></span><span style="color: black; font-size: x-small;"> </span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">*</span></span><span style="color: black; font-size: x-small;"> </span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;">FROM</span></span><span style="color: black; font-size: x-small;"> </span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">tempdb</span></span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">.</span></span><span style="color: lime; font-size: x-small;"><span style="color: lime; font-size: x-small;">sys</span></span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">.</span></span><span style="color: lime; font-size: x-small;"><span style="color: lime; font-size: x-small;">objects</span></span><span style="color: black; font-size: x-small;"> </span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;">WHERE</span></span><span style="color: black; font-size: x-small;"> </span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">name</span></span><span style="color: black; font-size: x-small;"> </span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">=</span></span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;"> </span></span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">(</span></span><span style="color: red; font-size: x-small;"><span style="color: red; font-size: x-small;">'ocupacion'</span></span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">)</span></span><span style="color: black; font-size: x-small;"> </span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">AND</span></span><span style="color: black; font-size: x-small;"> </span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;">type</span></span><span style="color: black; font-size: x-small;"> </span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">in</span></span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;"> </span></span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">(</span></span><span style="color: red; font-size: x-small;"><span style="color: red; font-size: x-small;">N'U'</span></span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">))</span></span></span></span><br />
<span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;"></span></span><span style="font-size: x-small;"> </span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;"><br />
</span></span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;">drop table<span style="color: black; font-size: x-small;"> </span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">tempdb</span></span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">.</span></span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">dbo</span></span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">.</span></span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">ocupacion</span></span></span></span><br />
<span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;"></span></span><span style="font-size: x-small;"> </span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;"><br />
</span></span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;">CREATE TABLE<span style="color: black; font-size: x-small;"> </span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">tempdb</span></span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">.</span></span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">dbo</span></span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">.</span></span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">ocupacion</span></span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">(</span></span></span></span><br />
<span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;"></span></span><span style="font-size: x-small;"> </span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;"><br />
</span></span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">[name]</span></span><span style="font-size: x-small;"> </span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">[varchar]</span></span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">(</span></span><span style="font-size: x-small;">256</span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">)</span></span><span style="font-size: x-small;"> </span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">NULL,</span></span><br />
<span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;"><br />
</span></span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">[Filename]</span></span><span style="font-size: x-small;"> </span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">[varchar]</span></span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">(</span></span><span style="font-size: x-small;">256</span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">)</span></span><span style="font-size: x-small;"> </span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">NULL,</span></span><br />
<span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;"><br />
</span></span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">[size]</span></span><span style="font-size: x-small;"> </span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">[int]</span></span><span style="font-size: x-small;"> </span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">NULL,</span></span><br />
<span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;"><br />
</span></span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">[usedspace]</span></span><span style="font-size: x-small;"> </span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">[int]</span></span><span style="font-size: x-small;"> </span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">NULL,</span></span><br />
<span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;"><br />
</span></span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">[id]</span></span><span style="font-size: x-small;"> </span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">[int]</span></span><span style="font-size: x-small;"> </span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">NULL,</span></span><br />
<br />
<span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">)</span></span><span style="font-size: x-small;"> </span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;">ON</span></span><span style="font-size: x-small;"> </span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">[PRIMARY]</span></span><br />
<span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;"><br />
</span></span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;">EXECUTE <span style="color: maroon;">sp_msforeachdb</span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;"> </span></span><span style="color: red; font-size: x-small;"><span style="color: red; font-size: x-small;">'USE [?] </span></span></span></span><br />
<span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;"></span></span><br />
<span style="color: red; font-size: x-small;"><span style="color: red; font-size: x-small;">insert into tempdb.dbo.ocupacion SELECT<br />
<br />
DB_NAME() AS [Name],<br />
<br />
s.physical_name AS [FileName],<br />
<br />
s.size * CONVERT(float,8) AS [Size],<br />
<br />
CAST(FILEPROPERTY(s.name, ''SpaceUsed'') AS float)* CONVERT(float,8) AS [usedspace],<br />
<br />
s.file_id AS [ID]<br />
<br />
FROM<br />
<br />
sys.master_files AS s<br />
<br />
WHERE<br />
<br />
(s.type = 1 and s.database_id = db_id())<br />
<br />
ORDER BY<br />
<br />
[ID] ASC'<br />
</span></span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;">EXECUTE <span style="color: maroon;">sp_msforeachdb</span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;"> </span></span><span style="color: red; font-size: x-small;"><span style="color: red; font-size: x-small;">'USE [?] </span></span></span></span><br />
<span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;"></span></span><br />
<span style="color: red; font-size: x-small;"><span style="color: red; font-size: x-small;">create table #tmpspc (Fileid int, FileGroup int, TotalExtents int, UsedExtents int, Name sysname, FileName nchar(520))<br />
<br />
insert #tmpspc EXEC (''dbcc showfilestats'')<br />
<br />
insert into tempdb.dbo.ocupacion SELECT <br />
s.name AS [Name],<br />
<br />
s.physical_name AS [FileName],<br />
<br />
s.size * CONVERT(float,8) AS [Size],<br />
<br />
CAST(tspc.UsedExtents*convert(float,64) AS float) AS [UsedSpace],<br />
<br />
s.file_id AS [ID]<br />
<br />
FROM<br />
<br />
sys.filegroups AS g<br />
<br />
INNER JOIN sys.master_files AS s ON (s.type = 0 and s.database_id = db_id() and (s.drop_lsn IS NULL)) AND (s.data_space_id=g.data_space_id)<br />
<br />
LEFT OUTER JOIN #tmpspc tspc ON tspc.Fileid = s.file_id<br />
<br />
ORDER BY<br />
<br />
[ID] ASC<br />
<br />
DROP TABLE #tmpspc'<br />
</span></span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;">GO</span></span><br />
<span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;">EXEC <span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">[dbo]</span></span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">.</span></span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">[ocupacion]</span></span></span></span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;"><br />
SELECT <span style="color: grey;">*</span><span style="font-size: x-small;"> </span><span style="color: blue; font-size: x-small;"><span style="color: blue; font-size: x-small;">FROM</span></span><span style="font-size: x-small;"> </span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">tempdb</span></span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">.</span></span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;">dbo</span></span><span style="color: grey; font-size: x-small;"><span style="color: grey; font-size: x-small;">.Ocupacion</span></span></span></span><span style="font-size: x-small;"> </span><span style="color: teal; font-size: x-small;"><span style="color: teal; font-size: x-small;"></span></span><br />
<br />
</span></span><br />
<span style="color: red; font-size: x-small;"><span style="color: red; font-size: x-small;"></span></span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5168662025343532743.post-43029007729482334252011-05-17T02:21:00.000-07:002011-05-18T01:57:45.276-07:00Aparecer en busquedas de Google,Bing y Yahoo.Muy Buenos Días.<br />
<br />
Buscando como hacer para que este nuevo blog aparezca en los buscadores me he interesado un poquito en el tema y la verdad es que es curioso.<br />
<br />
Si no apareces en Google o Bing o Yahoo no eres nadie y a veces es mejor animarles a que te encuentren de manera que os paso unas direcciones donde dar de alta vuestra web y empezar a aparecer en las busquedas.<br />
Google:<br />
<a href="http://www.google.com/addurl/?continue=/addurl" rel="nofollow" target="_blank">http://www.google.com/addurl/?continue=/addurl</a> <br />
Bing:<br />
<a href="http://www.bing.com/webmaster/SubmitSitePage.aspx">http://www.bing.com/webmaster/SubmitSitePage.aspx</a><br />
Yahoo:<br />
<a href="https://siteexplorer.search.yahoo.com/submit">https://siteexplorer.search.yahoo.com/submit</a><br />
<br />
Yahoo y Bing piden que te conectes con una cuenta de usuario para dar de alta vuestra URL.<br />
<br />
Espero que os resulte útil.<br />
Un Saludo.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5168662025343532743.post-55791289843189118372011-05-17T00:09:00.000-07:002011-05-17T00:09:59.399-07:00Correo entrante en Sharepoint sin SMTP - Parte 2.Saludos a todos .<br />
Viendo la solución me han surgido dudas con respecto al tema de reflejar la fecha en los correos entrantes.<br />
Sharepoint cuando recoje los correos de la carpeta de correo entrante utiliza el Subject para dar el nombre a la entrada en la biblioteca, ignorando el nombre del fichero y marcando como fecha y hora la que tiene en el momento de la recogida, no la original del envio.<br />
<br />
Si queremos reflejar de alguna manera este dato, podemos añadirlo al comienzo del nombre con esta modificación del Script Original.<br />
<br />
<br />
<div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">Set-ExecutionPolicy RemoteSigned -force</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">import-module messageops-exchange</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">$path = "c:\CARPETA TEMPORAL"</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">$path2= "C:\CARPETA DONDE SHAREPOINT RECOGE CORREO"</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span style="font-size: 10pt;">$apppath="C:\CARPETA DONDE INSTALAS TODO"</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span style="font-size: 10pt;">cd $apppath</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span style="font-size: 10pt;">$Inbox="\\bandeja de entrada"</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">import-module ./messageops-exchange.psd1</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">$user = "TUDIRECCION@TUEMPRESA.COM"</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">$ewsProfile = New-MessageOps.EWSProfile -usedefaultcredentials 1 -id $user<span style="color: red;">/*captura usuario actual*/</span></span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">$ItemCollection = Get-MessageOps.Messages -p $ewsprofile -fp $inbox -messagecount 1 -fulldetails $true</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="color: red; font-size: 10pt;">/*recoge un correo*/</span></i></b></div><div style="text-align: justify;"><b><i><span lang="EN-US" style="color: black; font-size: 10pt;">if ($itemcollection.sender.address -ne $null)</span></i></b></div><div style="text-align: justify;"><b><i><span style="color: black; font-size: 10pt;">{</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span style="font-size: 10pt;">if ($itemcollection.subject -eq $null) <span style="color: red;">/*si no tiene asunto se le añade como título “Sin Asunto”*/</span></span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span style="font-size: 10pt;">{$name = "Sin Asunto"}</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span style="font-size: 10pt;">else</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span style="font-size: 10pt;">{$name = $itemcollection.subject -replace(':',' ') }<span style="color: red;">/* Eliminamos caracteres especiales que puedan provocar error en el asunto error*/</span></span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">$name = $name -replace("`""," ")</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">$name = $name.replace("\"," ") </span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">$name = $name.replace('+',' ') </span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">$name = $name.replace('*',' ') </span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">$name = $name.replace('?',' ') </span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">$name = $name.replace('=',' ') </span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">$name = $name.replace('-',' ')</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">$name = $name.replace('[',' ') </span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">$name = $name.replace(']',' ') </span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">$name = $name.replace('''',' ') </span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">$sender = "x-sender: " + $itemcollection.sender.address <span style="color: red;">/* añadimos cabeceras para SharePoint*/</span></span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">$receiver = "x-receiver: " + $itemcollection.receivedby.address<span style="color: red;">/* añadimos cabezeras para SharePoint*/</span></span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span style="font-size: 10pt;">$file =$path + $name + ".eml" <span style="color: red;">/*Construimos el nombre del fichero con el asunto*/</span></span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">Export-MessageOps.MessageToEml -EWSProfile $ewsprofile -ewsid $itemcollection.id -filename $file</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">add-content ($path +"temp.eml") $sender</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">add-content ($path + "temp.eml") $receiver</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">$texto = get-content $file</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">add-content ($path + "temp.eml") $texto</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span style="font-size: 10pt;">del $file <span style="color: red;">/* borramos el fichero si existe en la carpeta de destino*/</span></span></i></b></div><div style="text-align: justify;"><div style="color: black;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span style="font-size: 10pt;">$temp = Get-Content ($path +"temp.eml") | Foreach-Object { $_ -replace ("Subject:", ("Subject: " + $date + " ")) } <span style="color: red;"> /* buscamos la cadena de texto Subject y le añadimos la fecha original*/</span><br />
add-content $file $temp<span style="color: red;"> /*salvamos el fichero en el destino final*/</span></span></i></b></div><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">del ($path + "temp.eml") <span style="color: red;">/*Borramos el fichero temporal*/</span></span></i></b><b><i><span style="font-size: 10pt;"><span style="color: red;"></span></span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt;">Remove-MessageOps.Message -ewsid $itemcollection.id -ewsprofile $ewsprofile <span style="color: red;">/*borramos el correo del buzón.*/</span></span></i></b></div><div style="text-align: justify;"><b><i><span style="color: black; font-size: 10pt;">} </span></i></b></div><div style="text-align: justify;">Como siempre se dice en estos casos, esto es un ejemplo, no lo uséis en producción, probarlo y reprobarlo antes de hacer uso de él.<br />
<br />
Saludos a todos. </div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5168662025343532743.post-26681329550881959352011-05-10T04:56:00.000-07:002011-05-10T07:27:47.323-07:00Primer Plato: Correo entrante en sharepoint sin SMTP.<div style="text-align: justify;">En los últimos días me ha tocado lidiar con un problema, no tan extraño, pero a la vez poco documentado.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">Os comento, tengo una granja de SharePoint 2007, sobre Windows 2008 y no tengo posibilidad de redirigir un conector Smtp desde Exchange, en mi caso 2010.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">Tras mucho buscar he encontrado recursos para montar una solución domestica para este proceso, la solución:</div><div style="text-align: justify;"><b><u>POWERSHELL</u></b>.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">Desde luego no es la opción que hubiese elegido para realizar esta conexión, pero ha resultado tremendamente efectiva. Descargo los ficheros con formato .eml con sus adjuntos y me permite añadir las cabeceras x-sender y x-receiver.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">Comencemos.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">Para empezar he instalado las herramientas de administración de Exchange, desde el DVD de instalación, en el servidor donde quería recibir los correos.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">A continuación encontré un kit de herramientas para Exchange, gratuito por supuesto en MessageOps.</div><div style="text-align: justify;"><a href="http://www.messageops.com/software/messageops-microsoft-online-powershell-extensions%20">http://www.messageops.com/software/messageops-microsoft-online-powershell-extensions </a>.</div><div style="text-align: justify;">Una gente muy maja a la que le agradezco encarecidamente este Kit.</div><div style="text-align: justify;">Lo descomprimimos en una carpeta que será donde guardemos nuestro script.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">Por otro lado descargue la Api de los Web services de Exchange.</div><div style="text-align: justify;"><a href="http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=c3342fb3-fbcc-4127-becf-872c746840e1">http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=c3342fb3-fbcc-4127-becf-872c746840e1</a></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">Ya tenemos todos los ingredientes.</div><div style="text-align: justify;">-Instalamos el Api de Exchange.</div><div style="text-align: justify;">-Descomprimimos el kit de messageops a una carpeta y abrimos la shell de Exchange como administrador y ejecutamos el script </div><div style="text-align: justify;"><i><b>.\install-module.ps1 </b></i>del kit.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">Ahora comprobamos como en la carpeta</div><div style="text-align: justify;"><span lang="EN-US" style="mso-ansi-language: EN-US;">C:\Users\usuario\Documents\WindowsPowerShell\Modules\MessageOps-Exchange</span></div><div style="text-align: justify;">Tenemos<span lang="EN-US" style="mso-ansi-language: EN-US;"> tres ficheros:</span></div><div style="text-align: justify;"><span lang="EN-US" style="mso-ansi-language: EN-US;">MessageOps-Exchange.psd1</span></div><div style="text-align: justify;"><span lang="EN-US" style="mso-ansi-language: EN-US;">MessageOps-Exchange-Powershell-Module.dll</span></div><div style="text-align: justify;">Microsoft.Exchange.WebServices.dll</div><div style="text-align: justify;">Si no los tenéis podéis copiarlos manualmente.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">Ahora viene la parte crítica de la solución. <span lang="EN-US" style="mso-ansi-language: EN-US;">EL SCRIPT.</span></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">Set-ExecutionPolicy RemoteSigned -force</span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">import-module messageops-exchange</span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">$path = "c:\CARPETA TEMPORAL"</span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">$path2= "C:\CARPETA DONDE SHAREPOINT RECOGE CORREO"</span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span style="font-size: 10pt;">$apppath="C:\CARPETA DONDE INSTALAS TODO"</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span style="font-size: 10pt;">cd $apppath</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span style="font-size: 10pt;">$Inbox="\\bandeja de entrada"</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">import-module ./messageops-exchange.psd1</span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">$user = "TUDIRECCION@TUEMPRESA.COM"</span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">$ewsProfile = New-MessageOps.EWSProfile -usedefaultcredentials 1 -id $user<span style="color: red;">/*captura usuario actual*/</span></span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">$ItemCollection = Get-MessageOps.Messages -p $ewsprofile -fp $inbox -messagecount 1 -fulldetails $true</span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="color: red; font-size: 10pt; mso-ansi-language: EN-US;">/*recoge un correo*/</span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b><i><span lang="EN-US" style="color: black; font-size: 10pt; mso-ansi-language: EN-US;">if ($itemcollection.sender.address -ne $null)</span></i></b><span lang="EN-US" style="color: black; mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b><i><span style="color: black; font-size: 10pt;">{</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span style="font-size: 10pt;">if ($itemcollection.subject -eq $null) <span style="color: red;">/*si no tiene asunto se le añade como título “Sin Asunto”*/</span></span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span style="font-size: 10pt;">{$name = "Sin Asunto"}</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span style="font-size: 10pt;">else</span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span style="font-size: 10pt;">{$name = $itemcollection.subject -replace(':',' ') }<span style="color: red;">/* Eliminamos caracteres especiales que puedan provocar error en el asunto error*/</span></span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">$name = $name -replace("`""," ")</span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">$name = $name.replace("\"," ") </span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">$name = $name.replace('+',' ') </span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">$name = $name.replace('*',' ') </span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">$name = $name.replace('?',' ') </span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">$name = $name.replace('=',' ') </span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">$name = $name.replace('-',' ')</span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">$name = $name.replace('[',' ') </span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">$name = $name.replace(']',' ') </span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">$name = $name.replace('''',' ') </span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">$sender = "x-sender: " + $itemcollection.sender.address <span style="color: red;">/* añadimos cabeceras para SharePoint*/</span></span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">$receiver = "x-receiver: " + $itemcollection.receivedby.address<span style="color: red;">/* añadimos cabezeras para SharePoint*/</span></span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span style="font-size: 10pt;">$file =$path + $name + ".eml" <span style="color: red;">/*Construimos el nombre del fichero con el asunto*/</span></span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">Export-MessageOps.MessageToEml -EWSProfile $ewsprofile -ewsid $itemcollection.id -filename $file</span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">add-content ($path +"temp.eml") $sender</span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">add-content ($path + "temp.eml") $receiver</span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">$texto = get-content $file</span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">add-content ($path + "temp.eml") $texto</span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span style="font-size: 10pt;">del $file <span style="color: red;">/* borramos el fichero si existe */</span></span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span style="font-size: 10pt;">ren ($path +"temp.eml") $file <span style="color: red;">/*renombramos el fichero */</span></span></i></b></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">MOVE $file $path2 <span style="color: red;">/*se mueve a la carpeta de SharePoint*/</span></span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;"><span lang="EN-US" style="font-size: 10pt; mso-ansi-language: EN-US;">Remove-MessageOps.Message -ewsid $itemcollection.id -ewsprofile $ewsprofile <span style="color: red;">/*borramos el correo del buzón.*/</span></span></i></b><span lang="EN-US" style="mso-ansi-language: EN-US;"></span></div><div style="text-align: justify;"><b><i><span style="color: black; font-size: 10pt;">} </span></i></b></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">Para ejecutarlo tendréis que eliminar todos los comentarios.</div><div style="text-align: justify;">Salvamos el fichero con extensión ps1.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">Lo guardaremos en la carpeta donde descomprimimos messageops.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">Por últimos, como programar la ejecución. Pues muy simple desde el programador de tareas ponemos en acciones la siguiente línea.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><b><i><span lang="EN-US" style="mso-ansi-language: EN-US;">c:\windows\system32\windowspowershell\v1.0\powershell "C:\ruta\correo.ps1"</span></i></b></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">Y elegimos la programación que deseemos, </div><div style="text-align: justify;">Nota: El script se descarga únicamente un correo cada vez, por lo que recomiendo ejecutarlo cada poco tiempo.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">Como siempre se dice en estos casos, esto es un ejemplo, no lo uséis en producción, probarlo y reprobarlo antes de hacer uso de él. </div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">Dejo para otra ocasión el desarrollo que hice hace tiempo para conectar con servidores de Exchange 2003.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">Un Saludo.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">Agradecimientos:</div><div style="text-align: justify;"><a href="http://www.microsoft.com/">http://www.microsoft.com</a></div><div style="text-align: justify;"><a href="http://www.messageops.com/">http://www.messageops.com</a></div><div style="text-align: justify;"><a href="http://gsexdev.blogspot.com/">http://gsexdev.blogspot.com</a></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><br />
</div><div class="MsoNormal"><br />
</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5168662025343532743.post-35222021910150253292011-05-10T03:19:00.001-07:002011-05-10T03:19:49.346-07:00Primeros PasosHoy abro mi primer blog para compartir aquellas cosas que el día a día y los cabezazos contra la pantalla me han enseñado.<br />
La periodicidad ni semanal , ni mensual, cuando me acuerde, tenga tiempo y ganas.<br />
Un Saludo.Unknownnoreply@blogger.com0