Chapter 17. Managing Local and Domain Resources with ADSI

Windows scripts and ADSI can help you build powerful tools for managing computers and domain resources. The ADSI provider you'll use to manage local resources on Windows computers is WinNT. You will also use the WinNT provider to manage domain resources. The focus of this chapter is on using WinNT to manage the following:

  • Domain account policies for both Windows Vista and Windows Server 2008

  • Domain user accounts for both Windows Vista and Windows Server 2008

  • Domain group accounts for both Windows Vista and Windows Server 2008

  • Local computer properties for both Windows Vista and Windows Server 2008

  • Local user and group accounts for both Windows Vista and Windows Server 2008

Managing Domain Account Policies

Using the WinNT provider, you can view and set domain account policies for Windows Vista and Windows Server 2008. In Windows NT, you normally access these properties through the User Manager's Account Policy dialog box. In Windows, you normally access these properties through Group Policy.

Working with domain objects

Before you can manage domain account policies, you must first obtain a reference to a domain object. In this example, you obtain the domain object for a domain named tvpress:

VBScript

Set dom = GetObject("WinNT://tvpress")

JScript var dom = GetObject("WinNT://tvpress") ...

Get Microsoft® PowerShell, VBScript and JScript® Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.