.....and verbose logs are pretty explicit - they usually say the line of code 
and column of the error for VBSript. 

Phil Wilson 


-----Original Message-----
From: Castro, Edwin G. (Hillsboro) [mailto:edwin.cas...@fiserv.com] 
Sent: Thursday, December 16, 2010 12:30 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Check if user exists in UI

Have you tried removing your usage of WScript in your vbscript code as Phil 
suggested? I'm no vbscript wizard so I don't know if the syntax below is good.

Function CheckUserExists
    strUserName = Session.Property("IAMUSERNAME")
    dtStart = TimeValue(Now())
    ' Determine DNS domain name.
    Set objRootDSE = GetObject("<a href="ldap://RootDSE/"; target="_top" 
rel="nofollow" link="external">LDAP://RootDSE")
    strDNSDomain = objRootDSE.Get("defaultNamingContext")

    Set objCommand = CreateObject("ADODB.Command")
    Set objConnection = CreateObject("ADODB.Connection")
    objConnection.Provider = "ADsDSOObject"
    objConnection.Open "Active Directory Provider"
    objCommand.ActiveConnection = objConnection
    objCommand.CommandText = _  "<LDAP://" & strDNSDomain & 
">;(&(objectCategory=User)" & _  "(samAccountName=" & strUserName & 
"));samAccountName;subtree"

    Set objRecordSet = objCommand.Execute
    If objRecordset.RecordCount = 0 Then
        Session.Property("USEREXISTS") = 1
    Else
        CheckUserExists = msiDoActionStatusSuccess
    End If

    objConnection.Close
End

Edwin G. Castro
Software Developer - Staff
Electronic Banking Services
Fiserv
Office: 503-746-0643
Fax: 503-617-0291
www.fiserv.com
Please consider the environment before printing this e-mail

> -----Original Message-----
> From: sangeeta1 [mailto:snmsn...@gmail.com]
> Sent: Thursday, December 16, 2010 12:12 PM
> To: wix-users@lists.sourceforge.net
> Subject: Re: [WiX-users] Check if user exists in UI
> 
> 
> I cannot use third party CA dlls unfortunately and hence struggling with
> vbscript. If there is any other means please share. Thanks.
> 
> 
> 
> 
> On Thu, Dec 16, 2010 at 2:44 PM, dB. [via Windows Installer XML (WiX)
> toolset] <ml-node+5843173-496378094-306...@n2.nabble.com<ml-
> node%2b5843173-496378094-306...@n2.nabble.com>
> > wrote:
> 
> > Instead of writing your own, use a CA from http://msiext.codeplex.com.
> >
> > CheckCredentials:
> > http://code.dblock.org/Source/msiext/1.2/Docs/_check_credentials_8h.ht
> > ml#a1db77a38daed9d05dfaa2bac173ec550
> > GetUserInfo:
> >
> http://code.dblock.org/Source/msiext/1.2/Docs/_user_info_8h.html#aba0b
> > 3481e2f5612373289a8fd4299f48
> >
> > Etc.
> >
> > dB. @ dblock.org
> > Moscow|Geneva|Seattle|New York
> >
> > -----Original Message-----
> > From: sangeeta1 [mailto:[hidden
> > email]<http://user/SendEmail.jtp?type=node&node=5843173&i=0>]
> >
> > Sent: Wednesday, December 15, 2010 12:57 PM
> > To: [hidden email]
> > <http://user/SendEmail.jtp?type=node&node=5843173&i=1>
> >  Subject: Re: [WiX-users] Check if user exists in UI
> >
> >
> > Hi,
> >
> >
> > I have a vbscript to validate the user in AD and I am having trouble
> > running it in the custom Action. Can someone point out mistakes in
> > implementing the custom action.
> > I am not a vbscript expert here so please pardon my ignorance.
> >
> > log
> > ----
> >
> > Action 11:42:48: CheckUserExists.
> > Action start 11:42:48: CheckUserExists.
> > MSI (c) (E8:94) [11:42:48:993]: Cloaking enabled.
> > MSI (c) (E8:94) [11:42:48:993]: Attempting to enable all disabled
> > privileges before calling Install on Server MSI (c) (E8:94) [11:42:48:993]:
> > Connected to service for CA interface.
> > Action ended 11:42:49: CheckUserExists. Return value 3.
> > DEBUG: Error 2896:  Executing action CheckUserExists failed.
> > The installer has encountered an unexpected error installing this package.
> > This may indicate a problem with this package. The error code is 2896.
> > The arguments are: CheckUserExists, , Action ended 11:42:49:
> > WelcomeDlg. Return value 3.
> >
> > Code
> > --------
> >
> > <CustomAction Id="CheckUserExists" BinaryKey="CheckUserExistsKey"
> > VBScriptCall="CheckUserExists" Execute="immediate"></CustomAction>
> > <Binary Id="CheckUserExistsKey" SourceFile="scripts\ADUserSearch.vbs"
> > ></Binary>
> >
> > vbscript
> > ----------
> >
> > Function CheckUserExists
> > Set shell = WScript.CreateObject("WScript.Shell")
> > strUserName = Session.Property("IAMUSERNAME") dtStart =
> TimeValue(Now()) '
> > Determine DNS domain name.
> > Set objRootDSE = GetObject("<a href="ldap://RootDSE/"; target="_top"
> > rel="nofollow" link="external">LDAP://RootDSE") strDNSDomain =
> > objRootDSE.Get("defaultNamingContext")
> > Set objCommand = CreateObject("ADODB.Command") Set objConnection
> =
> > CreateObject("ADODB.Connection") objConnection.Provider =
> "ADsDSOObject"
> > objConnection.Open "Active Directory Provider"
> > objCommand.ActiveConnection = objConnection
> objCommand.CommandText = _
> > "<LDAP://" & strDNSDomain & ">;(&(objectCategory=User)" & _
> > "(samAccountName=" & strUserName & "));samAccountName;subtree"
> >
> > Set objRecordSet = objCommand.Execute
> > If objRecordset.RecordCount = 0 Then
> >  'WScript.StdOut.WriteLine "sAMAccountName: " & strUserName & " does
> > not exist."
> >         Session.Property("USEREXISTS") = 1 Else
> > 'WScript.StdOut.WriteLine strUserName & " exists."
> >         CheckUserExists = msiDoActionStatusSuccess End If
> > objConnection.Close End
> >
> > --
> > View this message in context:
> > http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Check-if
> > -user-exists-in-UI-tp5829564p5838218.html<http://windows-installer-xml
> > -wix-toolset.687559.n2.nabble.com/Check-if-user-exists-in-UI-tp5829564
> > p5838218.html?by-user=t>
> >
> > Sent from the wix-users mailing list archive at Nabble.com.
> > ----------------------------------------------------------------------
> > --------
> >
> > Lotusphere 2011
> > Register now for Lotusphere 2011 and learn how to connect the dots,
> > take your collaborative environment to the next level, and enter the
> > era of Social Business.
> > http://p.sf.net/sfu/lotusphere-d2d
> > _______________________________________________
> > WiX-users mailing list
> > [hidden email]
> <http://user/SendEmail.jtp?type=node&node=5843173&i=2>
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> > ----------------------------------------------------------------------
> > --------
> >
> > Lotusphere 2011
> > Register now for Lotusphere 2011 and learn how to connect the dots,
> > take your collaborative environment to the next level, and enter the
> > era of Social Business.
> > http://p.sf.net/sfu/lotusphere-d2d
> > _______________________________________________
> > WiX-users mailing list
> > [hidden email]
> <http://user/SendEmail.jtp?type=node&node=5843173&i=3>
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> >
> > ------------------------------
> >  View message @
> > http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Check-if
> > -user-exists-in-UI-tp5829564p5843173.html
> >
> > To start a new topic under wix-users, email
> > ml-node+687560-220571316-306...@n2.nabble.com<ml-node%2B687560-
> 2205713
> > ml-node+16-306...@n2.nabble.com>
> > To unsubscribe from wix-users, click here<http://windows-installer-xml-
> wix-
> toolset.687559.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscrib
> e_by_code&node=687560&code=c25tc25tMTBAZ21haWwuY29tfDY4NzU2M
> HwtODkyOTExNTcy>.
> >
> >
> 
> --
> View this message in context: http://windows-installer-xml-wix-
> toolset.687559.n2.nabble.com/Check-if-user-exists-in-UI-
> tp5829564p5843271.html
> Sent from the wix-users mailing list archive at Nabble.com.
> ------------------------------------------------------------------------------
> Lotusphere 2011
> Register now for Lotusphere 2011 and learn how to connect the dots, take
> your collaborative environment to the next level, and enter the era of Social
> Business.
> http://p.sf.net/sfu/lotusphere-d2d
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

*** Confidentiality Notice: This e-mail, including any associated or attached 
files, is intended solely for the individual or entity to which it is 
addressed. This e-mail is confidential and may well also be legally privileged. 
If you have received it in error, you are on notice of its status. Please 
notify the sender immediately by reply e-mail and then delete this message from 
your system. Please do not copy it or use it for any purposes, or disclose its 
contents to any other person. This email comes from a division of the Invensys 
Group, owned by Invensys plc, which is a company registered in England and 
Wales with its registered office at 3rd Floor, 40 Grosvenor Place, London, SW1X 
7AW (Registered number 166023). For a list of European legal entities within 
the Invensys Group, please go to 
http://www.invensys.com/legal/default.asp?top_nav_id=77&nav_id=80&prev_id=77.

You may contact Invensys plc on +44 (0)20 3155 1200 or e-mail 
recept...@invensys.com. This e-mail and any attachments thereto may be subject 
to the terms of any agreements between Invensys (and/or its subsidiaries and 
affiliates) and the recipient (and/or its subsidiaries and affiliates).

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to