473,804 Members | 3,021 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with DirectoryEntry. Invoke method

Can anyone help with the use of the Invoke method of a
Directory Entry object? I am using vb.net.

I am trying to invoke the get_Filter method of the
IIS://LocalHost directory entry, and get the following
error: System.Reflecti on.TargetInvoca tionException

MSDN Library shows the following for the get_Filter method:

HRESULT get_Filter
([out] VARIANT *pvFilter);

I imagine the problem I am having is the [out] variable.
Do I need to somehow pass a reference to a variable?

Any help would be appreciated.

Nov 22 '05 #1
2 3191
I would resort to the nativeobject and use the appropriate interface if you
can't get the Invoke to work.

I tried several variations on a similiar Invoke on a standard
DirectoryEntry object and could not get it to work as I expected. However,
the DirectoryEntry is a managed wrapper around the Native ADSI interfaces
so you could use the de.NativeObject property to retrieve the base object
and use the property directly.

Sincerely,
Max Vaughn [MS]
Microsoft Developer Support
Disclaimer: This posting is provided "AS IS" with no warranties, and
confers no rights. You assume all risk for your use.

Nov 22 '05 #2
I would resort to the nativeobject and use the appropriate interface if you
can't get the Invoke to work.

I tried several variations on a similiar Invoke on a standard
DirectoryEntry object and could not get it to work as I expected. However,
the DirectoryEntry is a managed wrapper around the Native ADSI interfaces
so you could use the de.NativeObject property to retrieve the base object
and use the property directly.

Sincerely,
Max Vaughn [MS]
Microsoft Developer Support
Disclaimer: This posting is provided "AS IS" with no warranties, and
confers no rights. You assume all risk for your use.

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
401
by: Walter Zydhek | last post by:
Can anyone help with the use of the Invoke method of a Directory Entry object? I am using vb.net. I am trying to invoke the get_Filter method of the IIS://LocalHost directory entry, and get the following error: System.Reflection.TargetInvocationException MSDN Library shows the following for the get_Filter method: HRESULT get_Filter
0
1818
by: Wayne Gibson | last post by:
Hi all, Please ignore the other post.. The cat jumped on the machine and sent it before I could stop it!! Was wondering if anybody has expericence this problem.. I am writting an application in C# using windows forms, to create windows user profiles and then updating the registry information for the new profiles. I have managed to create the user successfully and thought that I was
6
2459
by: Diego Valencia | last post by:
The attach error was generate when I tried to use invoke method "setpassword" this is mi code objeto.Invoke("SetPassword", new object {contraseña}); The error is "The filename, directory name, or volume label syntax is incorrect" Exception Detail : System.IO.FileNotFoundException:The filename, directory
2
11701
by: Jessica | last post by:
When I create a single LDAP ActiveDirectory user and use DirectoryEntry.Invoke("SetPassword"...), the user is created and the password is set with no problems. However, when I try to add more than one user by calling my CreateUser method repeatedly, ADSI throws an exception when I try to set the password of the second (and all subsequent) users I create. Does anyone have a sense of why this is happening? The error states that one or...
0
1775
by: Jessica | last post by:
I have a .Net 1.0 web service that uses a .Net 1.1 assembly to create users, change users' passwords, validate users, and remove users from an LDAP server. The 1.1 code uses the DirectoryServices namespace. I am administering Active Directory through the Active Directory Users and Computers UI application on box 1 in domain A. Box 1 is not the domain controller in domain A. I can run the Web service from box 3 in another domain. I use...
0
3063
by: Ken Yee | last post by:
Anyone know how to do this in C#? It's pretty trivial in VB, but is being a PITA in C#. I can call the Start/Stop methods w/o any problems, but I can't figure out how to read the current status in C#? Code looks like this: DirectoryEntry obDirEntry = new DirectoryEntry ("IIS://localhost/W3svc/1"); obDirEntry.Invoke("Stop", new object {}); // Stop is not a synchronous call, so you have to poll status
1
4760
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem I have run into I am not sure how to fix, and really not sure what is causing it. Here's what is going on (test server - Windows 2003 Server): I have a page in a folder (under anonymous authentication in IIS6) that has a link on it that...
4
2110
by: Marc | last post by:
So I am having some issues with code written by another developer that interfaces with Active Directory. We had a catastrophic failure on the server and had to recreate the AD. No the following code does not work: DirectoryEntry ou = new DirectoryEntry("LDAP://ou=WISDM,dc=WISDM,dc=wisdm,dc=org", "username", "password"); // Use the Add method to add a user in an organizational unit. DirectoryEntry usr = ou.Children.Add("CN=" +...
8
11997
by: Chris Noble | last post by:
I need to check whether a particular user is already a member of an Active Directory Security Group. The following code extract works but only if the user distinguished name is exactly the same as that returned from Active Directory. For example using 'cn=' in the userdn string instead of 'CN=' does not work. As far as I am aware Active Directory is not case sensitive and it is therefore difficult to predict the case of a string.
1
1875
by: tommyk | last post by:
I am writing a small program that reads a text file filled with a large number of IP addresses and attempts to add them to IIS so that they will be blocked. For some reason, about one in every five or six ip addresses that I attempt to add to IIS causes an System.Reflection.TargetInvocationException to be thrown. Here is the code that adds the addresses: static void SetIPSecurityProperty(string metabasePath, string member, string item)...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10337
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9160
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6854
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3822
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2995
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.