New Active Directory cmdlets available on Windows Server 2012

When I read the PowerTip: Use a PowerShell Cmdlet to Obtain AD DS Replication Information this week end, I gave it a try and noticed that there are new cmdlets available in the Powershell Active Directory module 😀

On a Windows 2008 R2 server, I got the total count of cmdlets in this Active Directory module:

ipmo ActiveDirectory            
(Get-Command -Module ActiveDirectory).Count            


On a Windows 2012 server I did the same, except that the module wasn’t listed as the RSAT feature wasn’t enabled. First, I needed to load the feature:

Add-WindowsFeature -Name RSAT-AD-PowerShell -Restart:$false

To be able to use the Add-WindowsFeature cmdlet on Windows 2008 R2, you also first need to load the Server Manager module like this:

ipmo ServerManager

It isn’t required on Windows 2012 because of the module preloading feature.

Now I’m able to inventory the total count of cmdlets in the Active Directory module for Powershell on Windows Server 2012 by invoking the same command:

(Get-Command -Module ActiveDirectory).Count            

Cool, huge difference. Then I wanted to get the list of these new cmdlets.
On the Windows 2008 R2 server, I prepared a preformatted console output that I would be able to paste on the Windows Server 2012 like this:

Get-Command -Module ActiveDirectory | % { '"{0}",' -f $_.Name }

I copied/pasted the result in the ISE console, added the first line to define an array and replaced the last comma (@line 77) by a closing paranthese (@line 78).

Here’s the full code that was in the ISE tab:

$W2008R2ADcmdlets = @(            
"Add-ADComputerServiceAccount","Add-ADDomainControllerPasswordReplicationPolicy","Add-ADFineGrainedPasswordPolicySubject",            
"Add-ADGroupMember","Add-ADPrincipalGroupMembership","Clear-ADAccountExpiration",
"Disable-ADAccount","Disable-ADOptionalFeature","Enable-ADAccount","Enable-ADOptionalFeature",
"Get-ADAccountAuthorizationGroup","Get-ADAccountResultantPasswordReplicationPolicy","Get-ADComputer",            
"Get-ADComputerServiceAccount","Get-ADDefaultDomainPasswordPolicy","Get-ADDomain",            
"Get-ADDomainController","Get-ADDomainControllerPasswordReplicationPolicy",            
"Get-ADDomainControllerPasswordReplicationPolicyUsage",            
"Get-ADFineGrainedPasswordPolicy","Get-ADFineGrainedPasswordPolicySubject",            
"Get-ADForest","Get-ADGroup","Get-ADGroupMember","Get-ADObject","Get-ADOptionalFeature",            
"Get-ADOrganizationalUnit","Get-ADPrincipalGroupMembership",            
"Get-ADRootDSE","Get-ADServiceAccount","Get-ADUser","Get-ADUserResultantPasswordPolicy",            
"Install-ADServiceAccount","Move-ADDirectoryServer",            
"Move-ADDirectoryServerOperationMasterRole","Move-ADObject",            
"New-ADComputer","New-ADFineGrainedPasswordPolicy","New-ADGroup","New-ADObject",            
"New-ADOrganizationalUnit","New-ADServiceAccount","New-ADUser","Remove-ADComputer",            
"Remove-ADComputerServiceAccount","Remove-ADDomainControllerPasswordReplicationPolicy",            
"Remove-ADFineGrainedPasswordPolicy","Remove-ADFineGrainedPasswordPolicySubject",            
"Remove-ADGroup","Remove-ADGroupMember","Remove-ADObject","Remove-ADOrganizationalUnit",            
"Remove-ADPrincipalGroupMembership","Remove-ADServiceAccount",            
"Remove-ADUser","Rename-ADObject","Reset-ADServiceAccountPassword","Restore-ADObject",            
"Search-ADAccount","Set-ADAccountControl","Set-ADAccountExpiration","Set-ADAccountPassword",            
"Set-ADComputer","Set-ADDefaultDomainPasswordPolicy","Set-ADDomain","Set-ADDomainMode","Set-ADFineGrainedPasswordPolicy","Set-ADForest",            
"Set-ADForestMode","Set-ADGroup","Set-ADObject","Set-ADOrganizationalUnit",            
"Set-ADServiceAccount","Set-ADUser","Uninstall-ADServiceAccount","Unlock-ADAccount"            
)            
            
$W2008R2ADcmdlets.Count            
            
Get-Command -Module ActiveDirectory | % {            
    if ($_.Name -in $W2008R2ADcmdlets) {            
        # $true            
    } else {            
        # $false            
        $_             
    }            
} | Sort-Object -Property Name            

Executing the above code gives the 59 new cmdlets available in Windows Server 2012 😎

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s