Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Office > Misc

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 11-16-2005, 08:42 AM
Novice
 
Join Date: Nov 2005
Posts: 1
nukkumatti
Default Active Directory

Hi, i am quite new to Infopath. I created a form and want to read the current loged in user from an ActiveDirectory and write it to an expression box. But whatever i do i get all the time the same Error Message.
System.Security.SecurityException
Security error.
at ARF.ARF.OnLoad(DocReturnEvent e)
at Microsoft.Office.Interop.InfoPath.SemiTrust._XDocu mentEventSink2_SinkHelper.OnLoad(DocReturnEvent pEvent)

here is the piece of code i use for the access

string user = System.Environment.UserName;
Code:
IXMLDOMNode nodeUser = thisXDocument.DOM.selectSingleNode("my:myFields/my:user");

DirectoryEntry entry1 = new DirectoryEntry("LDAP://PCNAME");
Object obj1 = entry1.NativeObject		
DirectorySearcher searchInitiatorName = new DirectorySearcher(entry1);
searchInitiatorName.Filter = "(sAMAccountName=" + user + ")"
SearchResult result1 = searchInitiatorName.FindOne();
string fullName = result1.Properties["name"][0].ToString();
searchInitiatorName.Dispose();
entry1.Dispose();
nodeUser.text = fullName;
Would be really nice if someone could help me out



Regards[/code]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto-File Naming/ Default Directory Saves sgill32 Word 2 11-06-2008 02:12 PM
Active Directory ababc Misc 0 09-19-2006 06:18 AM
Newbie - extensions only working in root directory rlcarr71 Misc 0 04-24-2006 07:26 AM


All times are GMT -7. The time now is 11:50 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft