Sunday, November 20, 2011

How can I send an e-mail message from a script?

Send Mail from ScriptThere are a few simple ways to send e-mail messages from the command prompt or from within a script.

Method #1: MAILSEND
 
If you want to send a single e-mail message or hundreds of them and do it all from a single batch file or command you should use the MAILSEND program written by Muhammad A Muquit.

MAILSEND is a simple program to send mail via SMTP for MS Windows NT/2000/XP. To use it, you must know the address or IP address of the SMTP server you wish to use.

MAILSEND is a console application; you can run it from command shell or by clicking on the app from file explorer. You can use it in many ways. I'm using 192.168.0.200 as the IP address of the SMTP server as an example, change this to your valid one. Some example are shown below:


Tuesday, November 15, 2011

Task Scheduler error on Windows 2003 Server 0x80070005: Access is denied.

I tried to create a new task using Task scheduler as the same Domain Administrator user-id (or any other Domain Administrator user-id)  I get the following error:


Tuesday, November 8, 2011

Why Compact PST (Outlook Data) Files?

You're probably wondering, "What does it mean to compact Outlook data files (usually called Outlook PST files), and why should I do it?"
Your Outlook data is stored on your computer in one or more personal folders files, usually called .pst files.The .pst refers to the file extension assigned to these kinds of files. Anyway, every
Outlook data item (email message, task, contact, etc.) occupies space in a .pst file. So far so good.

So what happens to the .pst file when you delete an Outlook item? The item goes to Outlook's Deleted Items folder. Since the item can be recovered from there, it makes sense that the item still takes up some space in the .pst file.

Now what happens when you empty the Deleted Items folder? From our point of view, the item is completely gone. It can't be recovered using any normal means. And the item is deleted from the .pst file too. But the space it occupied is still unavailable for other uses.

Thursday, November 3, 2011

Excel opens, but the file doesn't

This problem sprang up out of nowhere on my XP laptop. All of a sudden, double-clicking an Excel document would open Excel, but not the file. It did not matter if the file was local or remote, if I accessed it via Explorer or not, or if another program (mail client, for instance) tried to call the file open command. Either way, I would be greeted with an empty Excel workbook. If I then chose File, Open, and browsed to my document it would then open it. Very frustrating, but I lived with it . . . until today . . .

I tracked down the problem to the file type associations in Windows XP. The resolution was quite simple once I knew what to do.

IIS 7 Websites failed to start. (Exception from HRESULT: 0x80070020)

This is IIS 7 in Windows 7. The web site is stopped and when I try to start it the error message (in subject) appears. 

The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)

This is an issue with binding conflict. There is another application that is using port 80. If you change the bindings for the default website to 8080 [for test purpose] it will work.
You can run NETSTAT -ano and find out the PID for the process that is using port 80, then you can compare that PID with the process name in task manager [may be skype.exe?]

 

Wednesday, November 2, 2011

Configure OpenFiler iSCSI targets

Last weekend I downloaded the OpenFiler iso to configure the Central Storage solution in my homelab. After installing the software in a new VM I figured out how to configure iSCSI targets and present them to my servers…
I’m running servers which provide iSCSI functionality by default to connect through to an iSCSI target.
After I installed OpenFiler in a VM I connected to https://ip:446, you can manage your service account with the created root account and you can manage the OpenFiler with the following credentials Username: Openfiler Password: password

How to Create and use the iSCSI target service on the NAS

Contents
  • Connect to the iSCSI targets by Microsoft iSCSI initiator on Windows
  • Connect to the iSCSI targets by Xtend SAN iSCSI initiator on Mac OS
  • Connect to the iSCSI targets by Open-iSCSI Initiator on Ubuntu Linux
What is iSCSI and how can one benefits from it?
Microsoft Active DirectoryiSCSI, (Internet Small Computer System Interface), an Internet Protocol (IP)-based storage networking standard for linking data storage facilities. By carrying SCSI commands over IP networks, iSCSI is used to facilitate data transfers over intranets and to manage storage over long distances. iSCSI can be used to transmit data over local area networks (LANs), wide area networks (WANs), or the Internet and can enable location-independent data storage and retrieval. (quoted from Wikipedia)

Setting up Database Mail for SQL 2005

Problem
Many things have changed with SQL Server 2005 and one of these changes is the replacement of SQL Mail with Database Mail.  This is a good thing, because SQL Mail relied on having a MAPI mail client installed such as Outlook in order for it to work.  With SQL Server 2005, this has changed and now the mail services use an SMTP server to send out emails which makes it a whole lot easier to setup and maintain.  So how do you setup Database Mail?

How to setup SQL Server alerts and email operator notifications in SQL 2005


Database Mail
First setup database mail with a profile named SQLAlerts. The profile can be named anything but in these instructions, the profile name SQLAlerts is referenced. If you wish to use a different profile name just substitute accordingly. For procedures in setting up database mail,see the post.

How to resolve : Agent XPs disabled

You may have seen this sentence in front of your SQL Server Agent in SSMS. and so you can’t start your SQL Server Agent ( maybe only with Network Service account )
You can enable Agent Xp’s in sql server 2005.  I think you’d better first create a Login and give proper roles to the user who run this service ( in my case Network Service with sysadmin role ). Then  run the below query in management studio to enable agent xp’s.

Tuesday, November 1, 2011

What SQL Server service pack & sort order do I have installed ?

If you've used SQL Server for a while,for checking Sort Order sp_helpsort and for summery of SQL servers config sp_server_info for service pack information you're probably familiar with the @@version function. run select @@version in Query Analyzer. Selecting the function in a query window produces the following results on my system.