略懂企业管理与信息化,涉及ITIL、OA、ERP、BPM、信息管理、架构、网络、数据库等

Owen Wang

快乐生活 生活快乐的IT老司机

导航

转载:PowerShell for Active Directory Examples

Posted on 2008-11-06 11:19  OwenWong  阅读(194)  评论(0编辑  收藏  举报

Andrei published on PowerGUI.org a bunch of how-to’s to Active Directory management with PowerShell:

In these posts Andrei shares some of his tips and tricks for using free Active Directory cmdlets to manage your AD environment.

Among the scenarios he covers are:

  • Enumerating users, groups and other objects
    • List all users in my domain
    • List all users in a specific OU
    • Get help on Get-QADUser parameters
    • Get specific user properties
    • List first-level organizational units in your domain
    • List all users in my domain with their display name and city
    • Find all users in my domain that has City attribute starts with ‘ny’
  • Updating user properties
    • Set description for a specific user account:
    • Set city to Liverpool for all user accounts in the Demo OU
  • User creation
    • Create user accounts
  • Group operations
    • Create a new group
    • Add all users with a specific description to a group
    • List group members, display names and descriptions
  • Bulk creation
    • Export useraccounts to a CSV file
    • Import useraccounts from a CSV file
    • Import useraccounts from CSV file and add them to a specific group
  • Statistics:
    • Count users, groups, OUs
    • Count departments
    • Get statistics for departments, locations, etc.
    • Count mailboxes per each mailbox store (will work against Exchange 2000 and Exchange 2003)

Note that all of them are one-liners! Managing Active Directory from command line has never been so easy.

源文档 <http://dmitrysotnikov.wordpress.com/2007/04/18/powershell-for-active-directory-examples/>

IT是企业管理目标实现的手段