Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


March 28, 2007

An MMC-less Way to Add Computers to Global Groups


RSS
View this exclusive article with VIP access -- click here to join |
See More Active Directory (AD) Articles Here | Reprints | Or sign up for our VIP Monthly Pass!

Our organization uses Microsoft Systems Management Server (SMS) 2003 to deploy software and updates. To ensure that SMS packages are received by computers worldwide, we allow our IT administrators to add computers to the predefined SMS global groups. Using the Microsoft Management Console (MMC) Active Directory Users and Computer snap-in to add computers to global groups takes multiple searches and many mouse clicks, so I wrote the AddComputers.vbs script to help administrators save time. This script also provides flexibility in that the IT administrators can add only those computers to which they want to deploy SMS packages.

Assuming CScript is the default engine, the IT administrator uses the following syntax to launch the script

AddComputers.vbs 
  C:\pclist.txt global_group

where global_group is the name of the global group to which they want to add the computers that are listed in C:\pclist.txt. In this input file, each computer name is placed on a separate line. For example, the input file might look like

Pc001
Pc002
Pc003

Listing 1 shows the main block of code in AddComputers.vbs. As you can see, after making the necessary declarations and checking for the input file's existence, the script converts the group name provided on the command line into a distinguished name (DN). It accomplishes this conversion using the dn function that Listing 2 shows. The dn function uses NameTranslate object, which is an Active Directory Service Interfaces (ADSI) object that translates ADsPath entries from one format to another in the LDAP namespace. (For more information about this object, see the "ADSI Objects of LDAP" Web page at http://msdn2.microsoft.com/en-gb/library/aa772208.aspx. ) . . .

Reader Comments

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
The website is down because someone removed the X-Box

What happens when a manager mistakes a server for a games console. ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

Microsoft Kills OneCare, Will Launch Free Security Solution

Microsoft on Tuesday announced that it would retire its $50-a-year security subscription product, Windows Live OneCare, and replace it with a free solution codenamed "Morro." Unlike OneCare, however, Morro will focus only on core anti-malware features and ...


Related Articles Using Saved Queries for Active Directory Management

Copy Group Memberships from One AD User to Another

Active Directory (AD) Whitepapers Sustainable Compliance: How to reconnect compliance, security and business goals

Managing Unix/Linux with Microsoft System Center Operations Manager 2007 Cross Platform Extensions Beta

Addressing the Insider Threat with NetIQ Security and Administration Solutions

Related Events Check out our list of Free Email Newsletters!

Task Automation eBooks Spam Fighting and Email Security for the 21st Century

Keeping Your Business Safe from Attack: Monitoring and Managing Your Network Security

Windows 2003: Active Directory Administration Essentials

Related Active Directory (AD) Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing