Wednesday 6 July 2011

Open instantly your favorite programs using DOS .bat file

Open Business Applications using simple DOS script
copy and paste the below code in yourfilename.bat and create a shortcut to your taskbar

@echo off
color 0E
:a
cls
echo _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
echo                         Business Applications - your company name
echo _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
echo 1) Open Intranet
echo 2) Open Employee Performance Management System (EPMS)
echo 3) Open Financial Institutions Regulatory information Management System (FIRMS)
echo 4) Open Time Management System (TMS)
echo 5) Open Internal Risks Information System (IRIS)
echo 6) Open Legal Advice Database (LAD)
echo 7) Open Regulatory Enquiries and Advice Database (READ)
echo 8) Open Mena ME Employee Self Services (HRMS)
echo.
echo.
echo =) Enter "+" for extras!
set /p TH=Type here:
if %TH%==1 goto 1
if %TH%==2 goto 2
if %TH%==3 goto 3
if %TH%==4 goto 4
if %TH%==5 goto 5
if %TH%==6 goto 6
if %TH%==7 goto 7

if %TH%==8 goto 8
if %TH%==~ goto S
if %TH%==+ goto Extra
:1
cls
start iexplore.exe
http://myintranetsite/default.aspx
echo.
echo.
pause
goto a
:2
cls
start iexplore.exe
http://hostedserver/abcd/abcpage/Home.aspx
echo.
echo.
pause
goto a
:3
cls
start iexplore.exe
http://hostedserver2/abcd/abcpage/Home.aspx
echo.
echo.
pause
goto a
:4
cls
start iexplore.exe
http://hostedserver3/abcd/abcpage/Home.aspx
echo.
echo.
pause
goto :a
:5
cls
start iexplore.exe
http://hostedserver3/abcd/abcpage/Home.aspx
echo.
echo.
pause
goto :a
:6
cls
start iexplore.exe
http://hostedserver4/abcd/abcpage/Home.aspx
echo.
echo.
pause
goto a
:7
start iexplore.exe
http://hostedserver5/abcd/abcpage/Home.aspx
echo.
echo.
pause
goto a
:8
start iexplore.exe
http://hostedserver6/abcd/abcpage/Home.aspx
echo.
echo.
pause
goto a

:Extra
echo.
echo Hey this is my blogspot,

start iexplore.exe http://ventej.blogspot.com/
echo.
pause
goto a
:S
echo Oh hello, You found my seceret!
start iexplore.exe http://www.blogger.com/home

echo.
echo.
pause

goto a

------------------------ends
if you have google crome or opera or firefox or any other browser, add the executable name of the browser (e.g. for Opera C:\Program Files (x86)\Opera\opera.exe in place of internet explorer  iexplore.exe in the code mentioned above) and the application hyperlink to open that application.
also refer DOS commands are fading coz of 21st century clicks and touch-sensing era

dos commands are fading coz of 21st century clicks and touch sensing era

 


command/ script output to existing file

Output commands to a text file
echo "my first line" > output_file.txt

write in an existing file
echo "my last line goes here" >> output_file.txt

reference

Incremental backup of data with .BAT

 DOS command: incremental backup
open notepad and copy the below code in a .bat file and then use windows scheduler to schedule eod backup to your external storage 
@echo off
xcopy C:\mydocuments D:\Backup\Docs /E /H /R /Y /I /D
xcopy "%USERPROFILE%"\Favoris D:\Backup\Favoris /E /H /R /Y /I /D

Sunday 3 July 2011

MOSS2007 evalution version license expired

Evaluation version of Microsoft Office SharePoint Server 2007 for this server has expired
Option 1:
This may happen exactly 180 days after upgrading moss2007 from SP1 to SP2.

Simple way of sorting this is to re-apply the license key from the CA:
Central Administration > Operations > Convert License Type   and then enter the product key and click ok. This may perhaps take more than 2-3 hrs for global sync depending on the FARM size.

Option 2:
ACTION:
Current user updated MOSS2007 and registered his Volume License Key to the MOSS2007 Installation.
Current user tries to Access his "My Site" or Dashboards
RESULT: Current user receives following error:
"The evaluation version of Microsoft Office SharePoint Server 2007 for this server has expired."
CAUSE: Insufficient permissions for the groups WSS_WPG, WSS_ADMIN_WPG to the Registry. The application pool identity for your WSS/MOSS sites *MUST* be in the
"Distributed COM Users" group in order to successfully activate.
RESOLUTION:
We gave group WSS_WPG Read permissions to following registry key
HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\Office Server\12.0
We gave group WSS_ADMIN_WPG Full permissions to the same registry key
HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\Office Server\12.0
Add application pool Account ("dcomcnfg.exe") to the Distributed users and then reboot the server. 

TELNET Command to Test SMTP Email Authentication

Simple and precise lines for SMTP Test:
you can use rcpt to command for multiple recipients while smtp test is being performed using telnet session.
telnet to your smtp address you should get a reply back saying 'OK' for each command line
-------------------------------------------------
telnet 192.168.110.100 25
HELO yourdomain.com
MAIL FROM:
Test@abc.com
RCPT TO: 123@abc.com
RCPT TO: 345@abc.com
DATA
Subject:((Test Email..!!))

This is an automated email.


.
QUIT

-------------------------------------------------
fyi: you will get error for 501 5.5.4 Unrecognized parameter, if you do any correction with the typed command line under telnet session. delete and backspace commands are not accepted. you have to type command without errors.
Note that the above code cannot be automated in a script as TELNET itself is a power shell. So telnet to smtp server port will take you to another console and the rest of communication commands will not work IF you make a batch file of the above code. For which the best method is to use vb script to send automated emails. Sending emails using this method can be used for alerting Admins after completion of an automated process.

Send Email using VBScript

VB Script to send email in a structured method

copy the below code to a notepad and save it in yourname.vbs and execute. You will note how to fetch the logged on username info, how to get hostname as well as domain name to a string, in addition to displaying email body fields.

'code starts here KTR----------------------------------
'sending email

Dim objNet
On Error Resume Next

'In case we fail to create object then display our custom error
Set objNet = CreateObject("WScript.NetWork")
If  Err.Number <> 0 Then                'If error occured then display notice
 MsgBox "Don't be Shy." & vbCRLF &_
               "Do not press ""No"" If your browser warns you."
 Document.Location = "UserInfo.html"  
                                        'Place the Name of the document.
                                 'It will display again
End if

Dim strInfo
strInfo =  "" & objNet.UserName + " from the machine " & objNet.ComputerName + " hosted at " & objNet.UserDomain + " Domain."

'MsgBox strInfo --- supress msgbox

'-- can go at last line-- Set objNet = Nothing                    'Destroy the Object to free the Memory


Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = strUserNTName+"Automated: ((Intranet Production Site level Backup Completed Successfully..!!))"
objMessage.From = "
intranetproductionserver@abc.com"
objMessage.To = "
123@abc.com, 456@abc.com"
objMessage.TextBody = "The backup was executed by: " & vbCRLF & _
+ strInfo  & vbCRLF & _
+""& vbCRLF & _
+"Site Level Backup for Intranet Main Site and Subsites: Enforcement, AML, HR & IT completed successfully..!!" & vbCRLF & _
+""& vbCRLF & _
+""& vbCRLF & _
+"Note: " & vbCRLF & _
+"At the time of site level backups all the sites remains locked until processed completely." & vbCRLF & _
+"Site level backup remains at shared location @
\\abc\MOSSBackup\ for 2 days." & vbCRLF & _
+" "& vbCRLF & _
+"Apart from this, daily SQL Content Database (eg.:WSS_Content, WSS_Content_IT, WSS_Content_ENF,..,) backups are automated to NAS storage location @
\\192.168.11.193\backup" & vbCRLF & _
+"These backups are written to Tape Library on a Daily, Weekly and Monthly basis. Monthly backup is finally taken out to the safe locker at ABC Bank." & vbCRLF & _
+" " & vbCRLF & _
+"In addition to the above process, Intranet Site is replicated on a real-time basis to the disaster recovery site at the QDC." & vbCRLF & _
+"" & vbCRLF & _
+"Backup Schedule: " & vbCRLF & _
+"i)   Site Level Backups (using STSADM command): Starts@ 11:20PM, Ends@ 3:20AM" & vbCRLF & _
+"ii)  All Content DB Backup (Back-End Maintenance Plan from SQL): Starts @6PM, Ends@ 11:15PM" & vbCRLF & _
+"iii) DocAve software is used for real-time replication" & vbCRLF & _
+"iv)  Symantec SharePoint Farm level Backup starts at 8PM" & vbCRLF & _
+""& vbCRLF & _
+"File Output Format: " & vbCRLF & _
+"Eg: IntranetBackup_IT_0307Sun.bak, IntranetBackup_ENF_0107Fri.bak, ..," & vbCRLF & _
+"" & vbCRLF & _
+ "Please note that this is an Automated email..! If you have any further concern(s) about the above process, please feel free to drop-in an email to
123@abc.com. I shall get back to you as soon as your email has been prioritized."+"" & vbCRLF & _
+"" +"" & vbCRLF & _
+"-ABC IT Team"
'==This section provides the configuration information for the remote SMTP server.
'==Normally you will only change the server name or IP.
objMessage.Configuration.Fields.Item _
("
http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("
http://schemas.microsoft.com/cdo/configuration/smtpserver") = "specify your smtp server"
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("
http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
'==End remote SMTP server configuration section==
objMessage.Send
Set objNet = Nothing

'code ends here KTR----------------------------------

DOS command doesnt really allow TELNET command for testing and processing automated emails