Wednesday, January 11, 2012

How to sent mail with attachment using batch

Sending mail using batch
Sending mail using Blat
Sending attachemt using blat
Sending mail with attachment using batch file

Blat with attachment script

For this purpose I use a command line utility which is not an installer but only an exe file.You will be able to download this from
For this script the minimum requirement is a mail rely server
syntax
Sending mail without attachment
blat "c:\some.txt" -t someone@somwhere.com -s "Some Subject" -i fromaddress@somedomain.com -f "replyaddress@somedomain.com" -q -server "your.relay.server.com
Here Some.txt is the message body which can be your Signature with message
Sending mail with attachment
Syntax
blat "c:\some.txt" -t someone@somwhere.com -s "Some Subject" -i fromaddress@somedomain.com -f "replyaddress@somedomain.com" -attach myattachment.jpg -mime -q -server "your.relay.server.com
Where myattachment.jpg is the jpg attachment

Monday, January 9, 2012

Can we map FTP to a Drive in Windows ?

Can we map FTP to a Drive in Windows ?

Yes ,You can
Windows Vista

1.       Open Windows explorer and choose "Map Network Drive " Option in the top
2.       Select "Connect to a Web site that you can use to store your documents and pictures”
3.       Click "Choose Custom network location"
4.       Provide FTP address for the site
5.       eg:ftp://ftp.yourdomain.com
6.       Uncheck "Anonymously" and Enter username for the FTP .Password will prompt while connect
7.       Finish the wizard and the wizard will launch a new window with the FTP location. You can save the password, if required

Windows XP

1.       Open Windows explorer and choose "Map Network Drive " from the tools Menu
2.       Select “Sign up for online storage or connect to a network server”
3.       Select "Connect to a Web site that you can use to store your documents and pictures "
4.       Click "Choose Custom network location"
5.       Provide FTP address for the site
6.       eg:ftp://ftp.yourdomain.com
7.       Uncheck "Anonymously" and Enter username for the FTP .Password will prompt while connect
8.       Finish the wizard and the wizard will launch a new window with the FTP location. You can save the password ,if required

Wednesday, January 4, 2012

Intermittent OCS login issue

Intermittent OCS login issue for Win7 Systems
Some of our remote users reported me that they were not able to login into OCS from Win-7 PCS. The error was
“Cannot sign in to Communicator.  You may have entered your sign-in address, user name, or password incorrectly, or the authentication service may be incompatible with the version of the program.  If your sign-in information is correct and the problem persists, please contact your system administrator”
Later I collected the communicator logs from the user system and I found the below line in the snooper window
“ms-diagnostics: 1013;reason="Significant time skew detected during authentication";source”

Resolution:
I found one DC which is recently added to the AD infrastructure which is having time difference more than 5 Min with respect to other DCs in the AD environment. I rectified it and resolved the issue
Reason:
This is office communicator Authentication issue, time skew of more than 5 minutes break Kerberos authentication.

How to configure squid to forward all traffic to another server

How to configure squid to forward all traffic to another server

Add the below lines in the Squid.conf file
# assign internal network
 
acl our_networks src 10.0.0.0/8 192.168.1.0/24 192.168.2.0/24
http_access allow our_networks
http_access allow intranet
##----------Added for Forwarding to Another Proxy ------------##
cache_peer 10.10.1.20 parent 4444 0 no-query default
never_direct allow our_networks

Here 10.10.1.20 is the another proxy server which is working on 4444 port and the proxy will forward all traffic except internal to it

Script to check whether a list of domain Names are available or not

Script to check whether a list of domains are available or not

Most of the IT professionals are curious  to  check whether there is any domains with interesting names are available with a specified root domain names. I would like to show you a linux  script which will check a list of words one by one and it will check different domain extensions (.net,.com,.org,etc) and it will create an output file with the available domain names .So that we can select some of them found interesting .
This script use a plugin named jwhois

Step 1
Install jwhois
        # yum -y install jwhois  for Redhat and Centos
   #apt-get install whois                                for Ubuntu
  • with this script you can check large number of domain at once
Step 2. Create a directory named scripts
#mkdir script
Step 3
Create a file named domain in the folder script
#cd script
#touch domain
Step 4
Create a file named check.sh and  enter the below lines
#vi check.sh

#!/bin/bash

for j in `cat /root/script/domains`
do
# Add the extentions which all you want to check.I only add 5 as below
DOMAINS=( '.com' '.co' '.in' '.net' '.co.in' )

ELEMENTS=${#DOMAINS[@]}

  for (( i=0;i<$ELEMENTS;i++)); do
      whois $j${DOMAINS[${i}]} | egrep -q \ '^No match|^NOT FOUND|^Not fo|AVAILABLE|^No Data Fou|has not been regi|No entri'
          if [ $? -eq 0 ]; then
              echo "$j${DOMAINS[${i}]} : available" >> /root/script/Available.txt
          fi
  done
shift
done

Step 5
Change the script so that it will be excicutable
#chmod 775 check.sh

Please confirm the paths of the file domain and check.sh are correct
Note: Check whether port 43 is open from your Linux machine to internet ,else you need to open the port in the firewall

  • domain name availability checker script
  • domain availability script

Force OCS to save conversation history into the Outlook folder immediately

How to force OCS to save conversation history into the Outlook folder immediately

There is a default time delay in saving OCS conversation history into the Outlook folder. And if we close the chat window before this, you may not get the conversation history updated on outlook.

To Enable Office Communicator Chat History in Outlook forcefully
Start -> Run->regedit and hit enter(you should logged into the system with a privilege who can edit registry values)
Use the registry setting in the path HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Communicator
If you couldn’t find "Communicator"  then add a new key with the same name and do the below steps

add a new DWORD ImAutoArchivingPolicy and put the value 1 or 0 as per your requirement (you can select decimal or hexadecimal )
1=archive OC conversations in Outlook

0=don't archive conversations in Outlook.