Configuring the Computer Account Location Attribute

Microsoft® Windows® 2000 Scripting Guide

microsoft windows 2000 scripting guide

« Previous | Next »   

The computer account Location attribute is crucial for administrative tasks that depend on knowing the physical location of individual or multiple computers. For example, knowing the physical location of individual computers enables you to dispatch service technicians to those computers. If a computer is no longer accessible over the network, you can use the Location attribute for the computer account to determine the actual physical location of the computer.

Location information can also help in identifying and diagnosing problems across the network. For example, if you observe that four computers having similar problems are located in the same general area, you might speculate that the problem is not with the computers themselves, but with the network infrastructure.

In addition, configuring the location for a computer allows you to use Active Directory printer location tracking. Printer location tracking enables users to quickly locate printers in their immediate proximity. To enable printer location tracking, you must develop a domain-wide naming scheme and use that scheme to specify the locations of all your printers and all your computers.

For more information about Active Directory printer location tracking, see "Printing" in this book.

You can use ADSI to configure the Location attribute for a computer account. Although the Location attribute for an individual computer can be easily changed by using Active Directory Users and Computers, scripts can be particularly useful if a large group of computers changes location at the same time (for example, when an entire department moves from one building to another).

Scripting Steps

Listing 9.6 contains a script that changes the value of the Location attribute for a computer. To carry out this task, the script must perform the following steps:

  1. Use a GetObject call to bind to the desired computer.
  2. Use the Put method to set the value of the Location attribute to Building 37, Floor 2, Room 2133.
  3. Use the SetInfo method to write the changes to the computer account.

Listing 9.6   Changing the Computer Account Location Attribute

1 2 3 4 
Set objComputer = GetObject _     ("LDAP://CN=atl-dc-01, CN=Computers, DC=fabrikam, DC=com") objComputer.Put "Location" , "Building 37, Floor 2, Room 2133" objComputer.SetInfo

send us your feedback Send us your feedback « Previous | Next »   


Microsoft Windows 2000 Scripting Guide(c) Automating System Administration 2003
Microsoft Windows 2000 Scripting Guide(c) Automating System Administration 2003
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 635

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net