Powershell Snippets

What follows are some short single line ommands that can be very useful while doing various things.
Note:Some of them require Quests AD Commandlets.

Active Directory Related

Disable UAC

To change the value and disable UAC via Registry. Very useful in Windows 8 and Server 2012.

Set-ItemProperty -Path registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system -Name EnableLUA -Value 0

Move all Disabled Computer Objects to a Disabled OU

get-qadcomputer -inactive | Move-QADObject -NewParentContainer "OU=Disabled Computers,DC=domain,DC=com"

Move all AD FSMO roles to another DC

Move-ADDirectoryServerOperationMasterRole -Identity “Target-DC” -OperationMasterRole SchemaMaster,RIDMaster,InfrastructureMaster,DomainNamingMaster,PDCEmulator

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s