473,805 Members | 2,141 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

read only domain controllers

Not sure which newsgroup this question should go to.

I want to find out, using .net c# code whether a domain controller on the
given machine is read only.
The logic I am using is as follows -
1. Use System.Manageme nt namespace - ManagementObjec t and ObjectSearcher
classes
2. First find out domain name for the given machine using
Win32_ComputerS ystem class - DomainName property
3. Use the domain name obtained in step 2 to query Win32_NTDomain class for
the domain objects which have the given domain name
4. Iterate through these objects, find an object whose
DSPrimaryDomain ControllerFlag is set to true. Read its DSWritableFlag
property. If it is false, the domain controller is read only.

Does this logic seem ok?
Posting the question since at present I am not able to test this code on a
machine with read only domain controller.

--
Thanks,
Sameeksha
MCAD.Net
Dec 26 '07 #1
0 1093

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

Similar topics

2
4817
by: Gerry | last post by:
I have a developer here with a website running with only "Windows Integrated Authentication" set on a Windows 2000 member server that uses GetObject to get a user's group membership in the domain. This is the code she's using: set adsUser = getobject("WinNT://" & strUsername) for each group in adsUser.groups GrpList = GrpList & lcase(trim(group.name)) & ";" next
2
1493
by: Vinodi | last post by:
Hi, I have a peculiar problem (or maybe not). I have SQL clients installed on XP boxes. These XP boxes are a member of let us say "XYZ" domain. SQL Server is installed on one of the boxes having Windows 2000 Server in the same network. The installation has been done on local domain account. Since SQl Server has been installed with Windows authentication, what happens if the XYZ domain fails. Will it be possible for all clients to access...
3
4006
by: Prasad Karunakaran | last post by:
I have the following C# code to enumerate the list of groups in a domain using ADSI. The problem is if the domain contains machine accounts ($) it get those accounts too. Can somebody help me here to filter out the machine accounts so that I get only the NT group objects. public ArrayList GetNTGroups() { DirectoryEntry ntDirectoryGroups = null;
2
1991
by: Jordan | last post by:
Suppose I register a domain name, MyDomain.com, through register.com (or any other of the many domain name registrars). I own the domain name. The domain name goes into the global DNS database. As the facilitator in this process, exactly what does the registrar *own* with respect to my specific domain name and/or the registration process? Briefly, what role does InterNIC play in all of this?
8
6266
by: Sameh Ahmed | last post by:
Hello there I need to get a list of domain controllers to a domain I bind too using it's name rather than the DN. I am trying a query looking for objectClass=nTDSDSA but this returns 0 results I am using VB.net 2.0 any ideas? Here's my code Thanks in advance.
0
1574
by: kanu | last post by:
Hi, We have moved our domain controllers from win2K to win3K. The script below doesnt work at all now because by default Win3K disables "Network access: Let Everyone permissions apply to anonymous users" GetObject("WinNT://domain/domainController/username,user") We are using GetObject to get the user groups, so as to restrict them to certain parts of the website. It still works with one of the old DC's which is win2K.
3
2382
by: dkm234 | last post by:
I am trying to read Account Management category events of Security Logs using EventLog class, but I can not read the event message. Error message: "The description for Event ID '565' in Source 'Security' cannot be found. The local computer may not have the necessary registry information or message DLL files to display the message, or you may not have permission to access them." Any suggestion? Also is it possible to read event log...
1
1425
by: Brian | last post by:
here is a question I've not been able to find the answer too.... I want to find domain controllers(or specifically time servers) on our private network. The computer that will run my app may or may not be in the domain, but is connected to the network. 1) how do I find all the domain controllers on our network(or if I have to, or can tell, time servers) 2)is it possible to find these as a non member of the domain? Brian
0
887
by: Brian | last post by:
Hi, when connected to the network and using dns or enviorment i can find the Host name or domainname... but I would like to find all domains controls on a network and if possible list the ones that have a active directory .. but then if the domain controller can't be found.. get the local computer name. Kind of like the windows log in screen it will list the local computer and any domain controllers on the network. I see there are...
0
9718
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
10613
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
10363
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
10368
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
10107
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
6876
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
5544
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
4327
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
3846
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.