473,657 Members | 2,397 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing command-line argument to Active Directory query.

Help!
I'm new to C# and am having trouble with the following code:
.....
DirectoryEntry root = new DirectoryEntry( "LDAP://<DOMAIN>");
DirectorySearch er searcher = new DirectorySearch er(root);
searcher.Filter = "(&(objectCateg ory=computer)(n ame=<MACHINE>)) ";
searcher.Proper tiesToLoad.Add( "memberOf") ;
SearchResultCol lection results = searcher.FindAl l();
.....
The plan is to specify 2 or more command-line parameters (/machine:<MACHIN E>) and have that value be passed to (name=<MACHINE> ) in the query filter. As it stands, the query works fine as long as I manually include a machine name in the code. However, I'm having trouble getting the variable data passed. Any suggestions would be much appreciated. Thanks in advance.
Nov 15 '05 #1
0 1027

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

Similar topics

2
17348
by: zlatko | last post by:
There is a form in an Access Project (.adp, Access front end with SQL Server) for entering data into a table for temporary storing. Then, by clicking a botton, several action stored procedures (update, append) should be activated in order to transfer data to other tables. I tried to avoid any coding in VB, as I am not a professional, but I have found a statement in an article, that, unlike select queries, form's Input Property can't be...
2
5267
by: Bob | last post by:
I'm new to Access projects and SQL server and am not a veteran VB programmer. There's a cry for help! I'm attempting to print the current form on screen by using a command button which the user clicks once they have selected the desired record. The button calls a report which uses a stored procedure as its record source. The SP has 2 input parameters, one of which is a datetime data type. In the input parameters data field of the...
11
3178
by: Arsen Vladimirskiy | last post by:
Hello, If I have a few simple classes to represent Entities such as Customers and Orders. What is the proper way to pass information to the Data Access Layer? 1) Pass the actual ENTITY to the Data Access Layer method -or- 2) Pass some kind of a unique id to the Data Access Layer method
1
3839
by: Mike | last post by:
Hello, How do I pass variables to a command text.(C#)Because of the quotes,it seems that the values are not passed. Thanks, Mike
4
2093
by: shade73 | last post by:
Hey all. I currently have two seperate namespaces and I'm trying to pass a connection around to them. I want to use the same connection & leave it open for 6 methods & then close it. However, all 6 of those methods use that same connection. So my solution was to pass the SqlConnection as a parameter in each method. This works, but it goes super slow. When I changed it back and put the methods all back in the same namespace & didnt...
5
3014
by: Chris Hieronymus | last post by:
Hi, I have a bunch of x-y data contained in an array. I would like to plot the data using an external program (psxy in GMT). The plotting program takes x-y couples as standard input. How do I get the data into the system call? I used to do things in csh and awk, i.e., something like
2
2434
by: | last post by:
I want to know how to make a clickable button or Command field on a GridView, and have the user's action a) fire a function and b) pass a data value from one of the GridView's columns to that function. Long version: ASP.NET's usual paradigm with master-detail editing is to have you define a commandfield, and on your detail view to define a second datasource that uses the SelectedValue of the GridView to determine what the detail record...
9
1902
by: orenr | last post by:
Hi We have a web site for 100 users using SQL Server. In our DAL all the selections when we need to pass parameters are using the SqlCommand and they are something like: SqlCommand com = new SqlCommand(); com.Connection = MyConnection; com.Transaction = MyTransaction; com.CommandText = ""SELECT CustomerID, CompanyName FROM Customers "
2
5039
by: Hakan Örnek | last post by:
Hi , I want to parameter passing to my windows sevice. I call service commands like this ; '------------------------------------------------------------ Dim sc As ServiceController sc = New ServiceController("ProsetLogServices") sc.MachineName = "." If sc.Status = ServiceControllerStatus.Stopped Then sc.Start() End If
3
4492
by: ajaymohank | last post by:
hello everyone..... i am ajay and i am new to php. in my project i have an option to invoke a bat file by passing parrameters and to diplay the result. i tried this code but my page got hung or display nothing... exec("c:\collabland\collabland.bat $distcode $tlkcode $villacod $block $svno"); here by passing this parameters to collabland.bat, a sketch will be generated based on the parameters and it should be displayed. when i type in...
0
8399
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
8312
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
8827
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
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...
0
8606
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
5632
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();...
0
4159
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2732
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1622
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.