I just noticed that Dmitry and the gang pushed the AD cmdlets into RTM. For those not familiar with what the AD cmdlets are. Let’s spend a few minutes going over them.
First off, for everyone that is just a little frustrated with trying to manage Active Directory using PowerShell please raise your hand. ***hand shoots up*** To sum up this frustration let’s just say that PowerShell leaves a little to be desired when it comes to managing AD. For example here is how we might create new user:
$OU = new-object DirectoryServices.DirectoryEntry(https://www.networkworld.com/ldap://OU=APAC,DC=companyabc,DC=com/)$User = $OU.Create("User", "CN=Bob Frank")$User.SetInfo()$User.sAMAccountName = "bfrank"$User.userPrincipalName = "bfrank"$User.SetInfo()$User.SetPassword('P@ssw0rd!')$User.psbase.InvokeSet('AccountDisabled', $false)$User.SetInfo()
Hmmmm…. Notice how I need to dip down into the base object? Conversely, here is how I would create a user using the AD cmdlets:
new-qaduser -Name “Jane Doe” -ParentContainer “OU=APAC,DC=companyabc,DC=com” -samAccountName “jdoe” -UserPassword ‘P@ssword!’ -UserPrincipalName jdoe@companyabc.com
enable-qaduser -Identity jdoe
Which method do you think is easier? Hopefully, your conclusion is the AD cmdlets as they are a good addition to anyone’s toolbox. The best part is that they are free and available for download here: Link
Enjoy!




