Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-16-2005, 08:42 AM
nukkumatti nukkumatti is offline
Novice
Active Directory
 
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

Other Forums: Access Forums

All times are GMT -7. The time now is 01:17 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft