Archive for November 27th, 2009

New cmdlets to manage AD computer accounts

Up to version 1.3, we used to have one cmdlet for computer accounts (namely Get-QADComputer) – now we have 6:

You can kind of guess what they do by their names, but let’s quickly go through them one by one and give a few quick examples.

Retrieves AD computer account objects based on the criteria you specify. E.g. (anyone still running Vista? 😉 )

Get-QADComputer spb* -OSName 'Windows Vista*' | Format-Table Name, ManagedBy

Creates new computer account in AD (does not join the actual computer though) and sets the attributes you specify:

New-QADComputer -Name 'LAB-SRV3' -SamAccountName 'LAB-SRV3' -ParentContainer 'CN=Computers,DC=lab,DC=local' -Location 'AMS/HQ/Building A'

Modifies AD computer account properties (can work in bulk when you pipe Get-QADComputer output into this one).

Set-QADComputer 'quest.local/computers/Comp4' -ManagedBy 'QUEST\DSotnikov'

or

Get-QADComputer spb* | Set-QADComputer -Location 'St. Petersburg'

Enable or disable one or multiple computer accounts:

Enable-QADComputer 'CN=LAB-SRV1,CN=Computers,DC=dom,DC=local'

or

Get-QADComputer -SearchRoot 'dom.local/labComputers' | Disable-QADComputer

Reset a computer account in Active Directory. When resetting a computer account, you reset the secure channel between the computer that uses that account to join the domain and a domain controller in the domain.Resetting a computer account breaks that computer’s connection to the domain and requires it to rejoin the domain.

Reset-QADComputer 'CN=LAB-SRV1,CN=Computers,DC=dom,DC=local'

More information can be found in AD cmdlets online reference and PDF guideDownload the new AD cmdlets now and let us know what you think by posting to the AD PowerShell discussion forum!


My Recent Tweets

Legal

The posts on this blog are provided “as is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer - WSO2 or anyone else for that matter. All trademarks acknowledged.

© 2007-2014 Dmitry Sotnikov

November 2009
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  

%d bloggers like this: