Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / April 2007

Tip: Looking for answers? Try searching our database.

Finding the domain name of the form user

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CoryP - 21 Mar 2006 19:54 GMT
I have a form that I am checking to see if the user is online or offline
using MachineOnlineState in order to get data from either a remote or local
database.  In order to access the remote database, the user not only has to
be online, but they need to be on the same domain as well.

So, in order to find out their DNSDomain, I did a GetObject on winmgmts in a
vbs file and it worked perfectly.  However, when I copied that code to the
script.vbs file for the InfoPath form, I get permission errors every time.

I am asking if anyone can provide me with a solution that will work within
an InfoPath form.  Or show me how to pass credentials in with the GetObject
of winmgmts.

Sorry if I did a bad job explaining this.  I hope you can understand.

-Cory
Uma Karnati - 22 Mar 2006 07:46 GMT
Hi cory,

I understand your problem..you explained it clearly.

I can't give the complete solution for your problem at now, But I'll give
one reason why you are getting the permission denaied errors in InfoPath.
Generally InfoPath requires "FullTrust" to use any external objects in any
scripting code.
I think you have  to implement your VBScript code with combination of the
InfoPath form which has under full trust.

I hope this will help you in one way to solve your problem.

Signature

Uma Karnati
http://www.autonomysystems.com

> I have a form that I am checking to see if the user is online or offline
> using MachineOnlineState in order to get data from either a remote or local
[quoted text clipped - 12 lines]
>
> -Cory
CoryP - 22 Mar 2006 16:46 GMT
That sounds like the solution.  However, someone has brought to my attention
that a form user could be on the domain, but still be unable to access the
remote server.  So I may have to rethink this.

Thanks though, "FullTrust" sounds like the answer to my problem.

> Hi cory,
>
[quoted text clipped - 25 lines]
> >
> > -Cory
funnybroad - 23 Apr 2007 21:18 GMT
Here's what I'm doing with a VBSCRIPT, and it works pretty good with no
"trust" issues:

Set objShell = CreateObject("WScript.Shell")
strUserName = objShell.ExpandEnvironmentStrings("%USERNAME%")
strUserDomain = objShell.ExpandEnvironmentStrings("%USERDOMAIN%")
strComputerName = objShell.ExpandEnvironmentStrings("%COMPUTERNAME%")
Set objShell = Nothing

I have "trust" issues when I then take the contents of the domain and user
name variables and try to do an LDAP query to get more information from
Active Directory.

> That sounds like the solution.  However, someone has brought to my attention
> that a form user could be on the domain, but still be unable to access the
[quoted text clipped - 31 lines]
> > >
> > > -Cory
funnybroad - 23 Apr 2007 21:22 GMT
p.s.

I just thought of something:  I'm not sure if these environment variables
are just something my company sets, or if they're default environment
variables for a Windows XP computer that is the member of a domain.  

> Here's what I'm doing with a VBSCRIPT, and it works pretty good with no
> "trust" issues:
[quoted text clipped - 44 lines]
> > > >
> > > > -Cory
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.