18 de dezembro de 2007

PowerShell commands for Active Directory

Ora aqui está um assunto que eu andava para blogar desde que o li no blogue do Evan Dodds.

A Quest disponibiliza o ActiveRoles Management Shell for Active Directory que mais não é que um conjunto de comandos PowerShell (CMDLETs) que podem ser descarregados de forma grátis da página da Quest e utilizados para realizar operações de administração na Active Directory.

The ActiveRoles Management Shell for Active Directory is an Active Directoryspecific automation and scripting shell that provides a command-line management interface for administering directory data either via Quest ActiveRoles Server or by directly accessing Active Directory domain controllers. The ActiveRoles Management Shell is built on Microsoft Windows PowerShell technology.

The ActiveRoles Management Shell is implemented as a Windows PowerShell snap-in, providing an extension to the Windows PowerShell environment.

As the commands provided by the ActiveRoles Management Shell conform to the Windows PowerShell standards, and are fully compatible with the default command-line tools that come with Windows PowerShell, the information found in the above documents of Microsoft’s is fully applicable to the ActiveRoles Management Shell for Active Directory.

Recentemente, necessitei de exportar todos os ProxyAddresses de vários utilizadores, pelo que estes cmdlets se revelaram bastante úteis. Aqui fica a linha de comando utilizada:

Get-QADUser -DontUseDefaultIncludedProperties -ObjectAttributes @{mail='*'} -IncludedProperties sAMAccountName,distinguishedName,mail,
userPrincipalName,proxyAddresses  -SerializeValues -SizeLimit 0 | Export-Csv 'C:\proxyAddresses.csv'

E esta é a lista de todos os cmdlets disponíveis:

CONNECT-QADSERVICE
DISCONNECT-QADSERVICE
GET-QADUSER
SET-QADUSER
NEW-QADUSER
DISABLE-QADUSER
ENABLE-QADUSER
UNLOCK-QADUSER
GET-QADGROUP
SET-QADGROUP
NEW-QADGROUP
GET-QADGROUPMEMBER
ADD-QADGROUPMEMBER
REMOVE-QADGROUPMEMBER
GET-QADCOMPUTER
GET-QADOBJECT
SET-QADOBJECT
NEW-QADOBJECT
MOVE-QADOBJECT
RENAME-QADOBJECT
REMOVE-QADOBJECT
NEW-QADPASSWORDSETTINGSOBJECT
GET-QADPASSWORDSETTINGSOBJECT
ADD-QADPASSWORDSETTINGSOBJECTAPPLIESTO
REMOVE-QADPASSWORDSETTINGSOBJECTAPPLIESTO
CONVERT-QADATTRIBUTEVALUE
GET-QADPSSNAPINSETTINGS
SET-QADPSSNAPINSETTINGS

Sem comentários: