Windows Scripting
  Home arrow Windows Scripting arrow Page 4 - Securing Computers and Active Directory
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
VeriSign Whitepapers 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WINDOWS SCRIPTING

Securing Computers and Active Directory
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2008-01-24

    Table of Contents:
  • Securing Computers and Active Directory
  • Resetting a Computer Account
  • Finding Inactive or Unused Computers
  • Changing the Maximum Number of Computers a User Can Join to the Domain

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Securing Computers and Active Directory - Changing the Maximum Number of Computers a User Can Join to the Domain


    (Page 4 of 4 )

    Problem

    You want to grant users the ability to join more or fewer than 10 computers to a domain. This limit is called the machine account quota.

    Solution

    Using a graphical user interface

    1. Open the ADSI Edit MMC snap-in and connect to the Domain Naming Context.
    2. Right-click on the domainDNS object for the domain you want to change and select Properties.
    3. Edit the ms-DS-MachineAccountQuota attribute and enter the new quota value.
    4. Click OK twice.

    Using a command-line interface

    In the following LDIF code replace <DomainDN> with the distinguished name of the domain you want to change and replace <Quota> with the new machine account quota:

      dn: <DomainDN>
      changetype: modify
      replace: ms-DS-MachineAccountQuota
      ms-DS-MachineAccountQuota: <Quota>
      -

    If the LDIF file was named change_computer_quota.ldf, you would then run the following command:

      > ldifde -v -i -f change_computer_quota.ldf

    You can also make this change using AdMod, as follows:

      > admod –b <DomainDN> ms-DS-MachineAccountQuota::<Quota>

    Using VBScript

      ' This code sets the machine account quota for a domain.
      ' ------ SCRIPT CONFIGURATION ------
      intQuota  = <Quota>
      strDomain = "<DomainDNSName>" ' e.g. emea.rallencorp.com
      ' ------ END CONFIGURATION ---------

      set objRootDSE = GetObject("LDAP://" & strDomain & "/RootDSE")
      set objDomain = GetObject("LDAP://" & objRootDSE.Get("defaultNamingContext"))
      objDomain.Put "ms-DS-MachineAccountQuota", intQuota
      objDomain.SetInfo
      WScript.Echo "Updated user quota to " & intQuota

    Discussion

    In a default Active Directory installation, members of the Authenticated Users group can add and join up to 10 computer accounts in the default Computers container. The number of computer accounts that can be created is defined in the
    ms-DS-MachineAccountQuota attribute on the domainDNS object for a domain. The default setting is artificially set to 10, but you can easily change that to whatever number you want, including 0, via the methods described in the Solution section. If you set it to 0, users have to be granted explicit permissions in Active Directory to join computers; refer to Recipe 8.3 for instructions on granting these permissions.

    Another method for granting users the right to addcomputerobjects, although not recommended, is via Group Policy. If you grant the “Add workstation to domain” right via Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> User Rights Assignment on a GPO that’s been linked to the Domain Controllers OU, then users will be able to create computer accounts even if they do not have create child permissions on the defaultComputerscontainer. This is a holdover from Windows NT to maintain backward compatibility and should not be used unless absolutely necessary. In fact, a good security best practice would be to remove this user right from any user or group objects that do not require it.

    See Also

    Recipe 8.3 for permissions needed to join computers to a domain, MS KB 251335 (Domain Users Cannot Join Workstation or Server to a Domain), and MS KB 314462 (“You Have Exceeded the Maximum Number of Computer Accounts” Error Message When You Try to Join a Windows XP Computer to a Windows 2000 Domain).

    Please check back next week for the conclusion to this article.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · This article is an excerpt from the book "Active Directory Cookbook, Second...
     

    Buy this book now. This article is excerpted from chapter eight of the Active Directory Cookbook, Second Edition, written by Robbie Allen and Laura E. Hunter (O'Reilly; ISBN: 059610202X). Check it out today at your favorite bookstore. Buy this book now.

    WINDOWS SCRIPTING ARTICLES

    - Generating Outlook Signatures Based on Activ...
    - VBScript: Converting and Formatting with Fun...
    - VBScript: Conversion and Format Functions
    - VBScript: Array Functions
    - VBScript: Strings, You Can`t Function withou...
    - VBScript: More String Functions
    - VBScript: Functioning with Strings
    - Working with the Windows Registry in C++
    - Understanding Objects
    - HTML Applications: Giving WSH a User Interfa...
    - Modifying Computer Objects with Active Direc...
    - Logon Script to Send Email Notifications
    - Securing Computers and Active Directory
    - Moving and Renaming Computers with Active Di...
    - Working with System Processes in WSH





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway