well
so many corporate customers were asking me for such a thing, users are keeping so many emails in their junk email folder and their inbox,
so how can delete them.
i searched and i found a great one @ glen scale's blog http://gsexdev.blogspot.com
i customized the script to prompet for user name and i will provide 2 scripts to delete email in inbox and junk email folders
to delete emails in inbox:
-----
ID = InputBox("Target what user?", "user Name?", _ "user1")ID = "file://./backofficestorage/yourdomain.com/MBX/" & ID & "/inbox"mailboxurl = IDset Rec = CreateObject("ADODB.Record")set Rs = CreateObject("ADODB.Recordset")Set Conn = CreateObject("ADODB.Connection")Conn.Provider = "ExOLEDB.DataSource"Rec.Open mailboxurl, ,3SSql = "SELECT ""DAV:href"", ""DAV:contentclass"" FROM scope('shallow traversal of """ & mailboxurl & """') " SSql = SSql & " WHERE (""urn:schemas:httpmail:datereceived"" < CAST(""" & isodateit(now()-0) & """ as 'dateTime')) AND ""DAV:isfolder"" = false" SSql = SSql & " AND ""DAV:contentclass"" = 'urn:content-classes:message'"Rs.CursorLocation = 2 'adUseServer = 2, adUseClient = 3rs.open SSql, rec.ActiveConnection, 3while not rs.eofrs.delete 1rs.movenextwendrs.close
function isodateit(datetocon)strDateTime = year(datetocon) & "-"if (Month(datetocon) < 10) then strDateTime = strDateTime & "0"strDateTime = strDateTime & Month(datetocon) & "-"if (Day(datetocon) < 10) then strDateTime = strDateTime & "0"strDateTime = strDateTime & Day(datetocon) & "T" & formatdatetime(datetocon,4) & ":00Z"isodateit = strDateTimeend function
-----
Junk email delete script
-----
ID = InputBox("Target what user?", "user Name?", _ "user1")ID = "file://./backofficestorage/yourdomain.com/MBX/" & ID & "/junk e-mail"
mailboxurl = IDset Rec = CreateObject("ADODB.Record")set Rs = CreateObject("ADODB.Recordset")Set Conn = CreateObject("ADODB.Connection")Conn.Provider = "ExOLEDB.DataSource"Rec.Open mailboxurl, ,3SSql = "SELECT ""DAV:href"", ""DAV:contentclass"" FROM scope('shallow traversal of """ & mailboxurl & """') " SSql = SSql & " WHERE (""urn:schemas:httpmail:datereceived"" < CAST(""" & isodateit(now()-0) & """ as 'dateTime')) AND ""DAV:isfolder"" = false" SSql = SSql & " AND ""DAV:contentclass"" = 'urn:content-classes:message'"Rs.CursorLocation = 2 'adUseServer = 2, adUseClient = 3rs.open SSql, rec.ActiveConnection, 3while not rs.eofrs.delete 1rs.movenextwendrs.close
function isodateit(datetocon)strDateTime = year(datetocon) & "-"if (Month(datetocon) < 10) then strDateTime = strDateTime & "0"strDateTime = strDateTime & Month(datetocon) & "-"if (Day(datetocon) < 10) then strDateTime = strDateTime & "0"strDateTime = strDateTime & Day(datetocon) & "T" & formatdatetime(datetocon,4) & ":00Z"isodateit = strDateTimeend function
----
Monday, March 10, 2008
Script to delete email in inbox and junk email folders
From the Field- insiders look to MOM 2005 grooming
One of the most important daily tasks for MOM 2005 is the grooming operation, from my experience MOM database can grow very large in a Mid-size network (between 50-75) servers. Many people are stucked in a situation were MOM database was growing so fast and filling the free disk space.
The solution was to add more disk space or free some, the free some phrase means grooming; however some MOM admins found that grooming the MOM database is a simple task usually, however one it comes to small free space it becomes so tricky task.let us take a look to how MOM grooming is processed.
MOM grooming is pure SQL task, scheduled to run in certain times to remove obsolete data, and move the information in the MOM database to MOM reporting database. The default MOM grooming tasks are:
Grooming Job
Definition
MOMX Partitioning And Grooming
Scheduled to run daily at 12 A.M. This job updates the partitioning information and grooms appropriate partitions.
OnePoint-Check Integrity
Scheduled to run once per week, on Saturday at 10 P.M. This job validates the integrity of everything in the MOM database. For example, it checks that the index and data pages are correctly linked and that indexes are in their proper sort order.
OnePoint-Computer Maintenance
Scheduled to run every five minutes. This job checks for computers that should come out of maintenance mode.
OnePoint-Reindex
Scheduled to run once per week, on Sunday at 3 A.M. This job rebuilds the MOM table indexes to improve performance. The OnePoint-Reindex job requires approximately 40 percent of free space within the database to successfully complete. For example, a 10-GB database needs 14 GB of database space to successfully rebuild the indexes. If the jobs fail due to a lack of disk space, the failure will not adversely affect your MOM implementation.
OnePoint-TodayStatisticsUpdateComputersAndAlerts
Scheduled to run every five minutes. This job updates the OnePoint Operations Manager Today window.
OnePoint-TodayStatisticsUpdateEvents
Scheduled to run every 30 minutes. This job updates the OnePoint Operations Manager Today window.
OnePoint-TodayStatisticsUpdatePerfmonRulesKB
Scheduled to run every hour. This job updates the performance, rules and Management Pack knowledgebase.
OnePoint-Update Database
Scheduled to run every hour. This job grooms automatically resolved alerts based on the information specified in the Global Settings dialog box.
OnePoint-Update Statistics
Scheduled to run once per day at 1 A.M. This job updates information about key value distribution in the database to improve performance.
the table above illustrates every scheduled task in the SQL server to maintain the MOM database, the most important tasks is the first and latest ones because they work in conjunction with MOM transfer job that transfers the MOM data from the MOM database to the reporting database. It is important to update the MOM database because you should auto resolve and update computer status and alerts based on the resolution state and monitoring data. The tricky part here is that you have to successfully transfer the Data from MOM database to reporting database or the grooming will not run.
The grooming for the MOM Database uses information in the Reporting DTS job to prevent the grooming from removing data that has not been transferred to the Reporting database.
If you don’t have the enough free disk space the transfer job will not be able to transfer the data from the MOM database, then the grooming will not occur, then you will run out of disk space!!!!.
How to come over this?!
Well, if you have additional Hard disk then you can the hard disk and configure a second data file and log file for the MOM database on that hard and run the process again, or detach and move the database and logs to the new hard disk as following:
Start (SQL) Enterprise Manager
· Expand SQL Server SQL Server Group Local Databases
· Expand “Onepoint” database
· Right-click on Database Onepoint
· Select all tasks
· Select detach database
· Select Clear to clear connections
· Select OK to message regarding transaction
· Select Yes to notify connection users
· Select OK to detach file
· Select OK to message “successfully detached”
· Close SQL Enterprise Manager
· Use Cut/Paste to move the file “old location”:\MOMdata\onepoint.mdf and LDF file to “new location”:\momdata\onepoint.mdf and LDF location
· From Query Analyzer
· Click eraser to clear query window statements; type Use onepoint Go Exec sp_attach_db ‘onepoint’, ‘“new location”:\momdata\onepoint.mdf’, ‘“new location”:\momdata\onepoint.ldf’ Go
· Click green arrow to execute
· Click OK on Error (code 911) – No entry found
But some companies don’t have the ability to afford a new hard disk specially if you run the MOM on a servers (HP, IBM..Etc). So what is the solution?
Usually I suggest staring from the Reporting database, why?, the answer is simple because the MOM reporting database is configured to save the data for 18 month, so most of the companies don’t need reports that belongs to 18 month ago, and if you will run out of disk space you will definitely need to fine tune this setting.
You can configure the reporting database to keep the data for example 6 month and groom the database, this will give you a great amount of free space. But you need to watch out again because grooming will cause the some logs which again requires disk space, so you will have to groom the reporting database in steps (30 days in each step for example) until you reach the required time limit.
Follow the below steps to groom the reporting database:
to configure the grooming date for the reporting database:
Declare @Groomdays int--Retain data for 300 daysSelect @Groomdays=300exec p_updateGroomDays 'SC_SampledNumericDataFact_Table', @Groomdaysexec p_updateGroomDays 'SC_AlertFact_Table', @Groomdaysexec p_updateGroomDays 'SC_EventParameterFact_Table', @Groomdaysexec p_updateGroomDays 'SC_AlertToEventFact_Table', @Groomdaysexec p_updateGroomDays 'SC_EventFact_Table', @Groomdaysexec p_updateGroomDays 'SC_AlertHistoryFact_Table', @Groomdays
in the query analyzer:
dbcc shrinkfile (“reporting DB file name”, 500 ) --use what ever size you need.
go
dbcc shrinkfile (“reporting DB log name”, 500 ) --use what ever size you need.
go
Repeat the above 2 tasks until you gain the desired free space to run the transfer job. Once you have the required free space, run the transfer job from the scheduled tasks in the control panel.
Once you have transferred the data from the MOM database you can groom them using the MOMX Partitioning And Grooming scheduled job from he SQL Enterprise Manager.
Mitigation:
Well the first step to mitigate this issue, is the successful sizing of the MOM server disks, add disks with adequate space to ease your life later.
Then monitor the SQL tasks and their failure cause, and don’t allow the logs and database to grow automatically, this will kill your hard disk free space.
to count the alerts that is waiting to be transferred:
SELECT Count(*) as alerts FROM dbo.Alert WHERE (ResolutionState=255)
It is easy to aid this issue in the beginning but it will be so hard to fix it later.
الدرس الثاني من ال SMS2003 التركيب و عمل Configuration
تم بالامس تحميل الدرس الثاني من سلسة دروس ال SMS 2003
الموضوع للنقاش في منتدى الفريق العربي على الموضوع التالي
http://www.arabteam2000-forum.com/index.php?showtopic=107382
محتويات الفيديو
عمل configuration لل SMS للعمل
عمل Push لل SMS client
استعمال ال Hardware inventory و ال Remote tools و ال software inventory
نظرة على ال SMS 2003 reports
و يمكن طرح اي سؤال هنا و انا سأكون سعيدا بالرد
يمكن مشاهدة الشرح الفيديو من على جوجل
http://video.google.com/videoplay?docid=-3256759248706485445&hl=en
و لا تنسونا من الدعاء
و منتظر اسئلتكم
شرح ال SMS 2003
بالامس قمت بالبدء بنشر مجموعة دروس فيديو من صنعي في ال system management server 2003
و الفيديو الاول كان يتحدث عن
تم تناول نظرة عامة على ال SMS 2003
وظائف ال SMS 2003
كيف يتعامل الكلاينت مع توزيع السوفتوير
انواع الكلاينت الموجودة في ال SMS
المميزات العامة لل SMS 2003 مثل توزيع البرامج و ال asset management و ال indows update و ال operating system deployment
و ان شاء الله تيم وضع درس التركيب لاحقا
يمكن مشاهة الفيديو من جوجل
http://video.google.com/videoplay?docid=-719633428589816219&hl=en
او تنزيل الفيديو من
http://up-file.com/download/5a286e542068/SMS-overview-edited.wmv.html
سنة مع سينرجي
امممم
اليوم واحد سبتمبر و هذا يعني انه مرت سنة بالتمام و الكمال و انا في شركتي العزيزة سينرجي ، سنة كاملة عملت خلالها في اروع شركة يمكن ان اعمل بها ، انا مش بقول كده لانه انا عضو في الشركة ، او لانه كل ايامي كانت هنا و سرور ، لقد عملت بجد مع افضل فريق يمكن ان اعمل معه على الاطلاق
بيئة ساعدتني على الابداع و التألق ، اناس صقلوا من مواهبي و قدراتي ، اعطوني الفرصة و وثقوا في قدراتي
عملت باكبر المشاريع و افخم الشركات معهم
فعلا انا سعيد بعملي و انضمامي هناك
اشكر اخوتي : رضا شريف و احمد وائل و طارق اسماعيل و محمد حمودة و عصام شفيق على تعاونهم و عملنا معا كفريق
اشكر الشخص الذي اصر ان اكون افضل من الافضل و اعطاني الفرصة محمد مرزوق
اشكر مديري عادل البير
اشكر مدير الشركة الذي وثق في قدراتي و اعطاني الفرصة الذهبية و الذي امل اني لم اخيب ظنه وائل خطاب
اشكركم جميعا و اتمنى ان نرى سينرجي في تألق السنة القادمة
-----
بعض انجازاتي السنة الماضية في سينرجي:
- الحصول على MCSA(Messaging)
- الحصول على MCSA security
- الحصول عل ىMCSE security
بعض من مشروعاتي السنة الماضية:
- مشروع الابجريد للمنظومة كاملة و التخطيط لل Migration في منظمة الصحة العالمية
- عمل الابجريد بشركة Mcdonalds
- عمل و تصميم منظومة امن المعلومات ب Nathan
- تركيب و تنفيذ البنية التحتيه لل Live communication server باوراسكوم تيليكوم
ده اللي فاكره بس هما اكتر من كده
سنة حلوة عليا يا سينرجي و من تألق الى تألق
Transport Dumpsterتابع exchange 2007 نظرة اولى
ال Trasport dumpster هو ميزة جديدة في Exchange 2007 و هو لازم لكي يتم عمل ال CCR Cluster continouse replication
ال TD هو يوجد على كل HTS سيرفر ، الفكرة كلها انه في حالة فشل اي نود في الكلاستر المعرف باستخدام ال CCR فانه النود تقوم بعمل query لكل ال HTS الموجودة لانه ال TD يقوم بتخزين الايميلات التي تم ايصالها الى اي نود في ال CCR cluster ، تقوم النود بتحديد ال Duplication و مسحة و اضافة اي ايميلات لم يتم ايصالها و بالتالي ضمان انه كل الmail boxes بها اخر الايميلات
انا افكر--اذن انا في خطر
ربما تراكمت علينا الاحداث الكثيرة و المقرفة في الفترة الاخيرة مما حذا بالبعض الى تجنب التفكير تماما
بل و الادهى انه انت اصبحت في خطر اذا فكرت
الحادث ده اتقالي بالنص كنت في اجتماع و طلب مننا حل معضلة في الشبكات و الكل تمسك رأيه فقلت اذن لنفكر بطريقة اخرى ، وجدت وجوم في المنطقة وواحد مال عليا و قاللي نفكر !!!!!!
و كأني طلبت منه انه يقلع عريان (اسف )
المشكلة انه انا بفكر و اصبحت غريب في مجتمعي الذي اصبح من يفكر فيه متهما بتهمة الخيانة العظمى
مشكلة اصبحنا نعانيها في المقابلات التي نجريها للوظائف في شركتنا ، عملنا امتحان ذكاء مكون من 6 اسئلة (اكتر من كده لقينا انه الناس بتطول بشكل غير طبيعي)
احد الاسئلة : في البيت 3 تفاحات اخدت و انت نازل من البيت اتنين يبقا معاك كام ؟ بسيطة مفيش اي عقد لو انت يعني تخيلتها حيكون معاك اتنين ، لقينا انه محدش بيجاوب ناس تقول 3 و ناس تقول واحد (واحد قال معاييش ولا تفاحة)
و لانه الاغلبية جاوبت واحد روحنا قولنا نسهل السؤال و عكسناه (معاك في البيت 3 تفاحات اخدت و انت نازل اتنين يبقا في كام في البيت) مش عارف اقول ايه بس و الله كما تتوقعوا الكل جاوب 2
سؤال تاني (في ولاية كاليفورنيا هل يجوز لرجل انه يتجوز اخت ارملته) سؤال سخيف مش كده
خد بقا عندك
اه ينفع
معرفشي
اكيد
بس في اتنين جامدين جدا جدا جدا
واحد قال
انا مسافرتش كاليفورنيا و انا لا اعرف القوانين هناك
التاني الجامد اوي
في امريكا قانون يمنع الرجل من الزواج باتنين
فانا في خطر يا رجالة ، انا افكر و هذه مشكلة ، انا افكر في امور بسيطة و غالبا سيتم سن قانون بمنع التفكير قريبا و ربما تسمعوا عني في الاخبار (القبض على عميل خائن بتهمة التفكير)
لذا متفكروش ، لانه الغباء و البلاهة و التفاهة اصبحت هي القيمة ، و اذا قبض علي فقولوا عني اني مكونتش عايز افكر بس كنت مريض بفيروس المخ و التهاب العقل و اني حاولت بس مقدرتش
و في الاخر انا عندي واوا عايز حد يبوسهالي