Wednesday, 6 July 2011

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

Monday, 27 June 2011

Unable to pick AD Attributes from SharePoint for new users

AD attributes not in sync with some of the subsites:

Created a new user profile attribute but these attributes are not available when adding a new column using "person or group" column type... what could be wrong??

Follow the steps to achieve the expected sync on all sites:
Stsadm -o sync -listolddatabases 0
Stsadm -o sync -deleteolddatabases 0 (deletes from cache old databases)
Stsadm -o sync -IgnoreIsActive 1

Stsadm -o sync -synctiming M:1
check profile sync (CA» Operations» Global Configuration» Timer Job Status» scroll down to Profile Synchronization and check for any errors)
check quick profile sync (CA» Operations» Global Configuration» Timer Job Status» scroll down to Quick Profile Synchronization and check for status to track down success/ aborted errors)

run again Stsadm -o sync -listolddatabases 0


if all the content databases are not listed as a result of the above command, try removing content database and attach again.. if you are on production environment, plan and schedule after office hours.. recommended to do db remove/ attach on pre-production first.

how to do this?
Go to Central Administration > Application Management > Content Databases
select each content database, copy exactly the same name of content DB (ex: WSS_Content_HR). Remove content database. Now Add content database. specify exactly the same database name (ex: WSS_Content_HR). Click ok.

Stsadm -o sync -listolddatabases 0




hover mouse over the content database and see the database ID if its in sync with the results you just retrieved after running the command stsadm -o sync -listolddatabases 0
------------------------------------------------------------------------------------------------------
ID: b4fc6c18-a622-498d-8f33-426225dfb22d  Synchronized: 6/27/2011 4:31:03 PM
ID: 943f1a54-245c-4b66-8127-90e7e71066de  Synchronized: 6/27/2011 4:31:03 PM
ID: 4be6b4ee-bb5d-4374-8eb0-a755f0b3350a  Synchronized: 6/27/2011 4:31:02 PM
------------------------------------------------------------------------------------------------------
change back the sync timing to 1 hour to avoid any conflicts.
Stsadm -o sync -synctiming H:1

Also try to Clear the SharePoint Configuration Cache.. refer here . Any issues share here your comments. Please note that you need to stop the windows sharepoint services timer job from services before clearing sharepoint config cache.

Friday, 24 June 2011

Vanishing Trick Revealed

Your credulity is blackmagic witche's and magician's powerful weapon. Magicians Trick revealed.. interested to watch?

David Copperfield - Flying Revealed
vanishing train trick revealed
statue of liberty trick revealed