hey Rajeev.
If you are just passing user/login ID it would probably be easier justt to use a Active Directory web service like you can download off the site. How I have done it in the past is using one form to launch the other form and passing the parameters between the forms. Other methods would be to put the data into a table or xml file and then pull it for the next form.
Depends on what exactly you need.
Here is a sample Java Script that works from the command line or could be called from a form which passes 4 variables.
//myscript.js
//parse parameters
if(WScript.Arguments.count()==4)
{
var param1 = WScript.Arguments.Item(0);
var param2 = WScript.Arguments.Item(1);
var param3 = WScript.Arguments.Item(2);
var param4 = WScript.Arguments.Item(3);
}
//Start the application
var oApp = new ActiveXObject("InfoPath.Application");
WScript.Echo("InfoPath Version: " + oApp.Version);
//Open an InfoPath document from the published template
var oXDocumentCollection = oApp.XDocuments;
var oXDocument = oXDocumentCollection.NewFromSolution("http://insideen/sites/HR/HRIS/Shared%20Documents/Test.xsn");
// Get pointers to the target fields
var oDpt = oXDocument.DOM.selectSingleNode("//my:Number");
var oName = oXDocument.DOM.selectSingleNode("//my:Name");
var oFT = oXDocument.DOM.selectSingleNode("//my:FormType");
var oTst = oXDocument.DOM.selectSingleNode("//my:Test");
//Update the fields
oDpt.text = param1;
oName.text = param2;
oFT.text = param3;
oTst.text = param4;
//Submit the Form
//oXDocument.Submit();
//Close up shop
//oXDocumentCollection = null;
//oApp.Quit();
//oApp = null;