Hello. I've actually recently written a program to manage user groups on remote servers, including add an expiration date/time when that user will be removed. I'll be posting an article on it soon. Here is some code that should help you out. You will need to add a reference to System.DirectoryServices, and using statements for System.DirectoryServices and System.Collections:
String entryString = "WinNT://" + computerName + ",computer";<br />
DirectoryEntry dirEntry = new DirectoryEntry(entryString, username, password);<br />
foreach (DirectoryEntry entry in dirEntry.Children)<br />
if (entry.SchemaClassName.Equals("group", StringComparison.CurrentCultureIgnoreCase))<br />
if (entry.Name.Equals("Administrators"))<br />
object members = entry.Invoke("Members", null);<br />
foreach (object member in (IEnumerable)members)<br />
DirectoryEntry memberEntry = new DirectoryEntry(member);<br />
String name = memberEntry.Name;<br />
String path = memberEntry.Path;<br />
MessageBox.Show(path + "\n" + name + "\n" + memberEntry.SchemaClassName);<br />
The problem is that I need to connect with alternate credentials. All my servers have different password.
WinNT provider by default uses pass-through authentication, which means takes your currently logged on priviledges to connect to remote computer. This works good if I have common password as I login using same passowrd. But that is very risky, a malicious code can then play aroumd.
I am also trying to find out way to connect using alternate credentials, If you get to know first please post it
By the way, there's option in directory entry class to specify user/password but in that case the output is blank, not sure why.
Basically there are two ways to do this,
Push (server pushes data to the client) and Pull (client sends a request and recives a response. HTTP is pull)
To implement a Push based system, you have 2 choices. Sockets (TCP/IP networking) and .Net Remoting.
A client server system using TCP/IP will need a custom server built using C#. This can run as a Windows service or as a standalone application. The server component cannot be built usiing ASP .Net. This gives you more control over the data and the server controls the update frequency. However, you will have to implement your own data protocol.
The advantage here is that you can achieve better performance, because you have more control over the client and the server. However, this depends a lot on your design and implementation. (Bad design== bad performance)
Remoting uses .Net objects. Clients can call objects on the server, and the server can call client methods. Compared to TCP/IP networking this gives you much less performance, but much more easier to implement. I haven't used remoting much to give an accurate description.
A Pull based system is similar to HTTP. The client makes a web request and recieves a response to it. This is done by using ASP .Net and .Net webservices. This gives you the automatic performance benefits of ASP .net like caching and the fact that your web server handles the connections more efficiently than your own custom server.
It will also be easy to scale out when using a web server. I've built web applications that handle upwards of 5000 clients making requests every 10 seconds.
What? How does this describe a thick (fat) client?
Does this sound like Microsoft Excel or Word to you? A fat client performs the bulk of processing on the client. That's it. It's not a difficult concept, and doesn't rely on push/pull architectures at all.
Deja View - the feeling that you've seen this post before.
hi, i need your suggestion on how to do data binding to display a table consisting of data that is obtained from xml file. The table is created using listbox and should have the structure as shown below: