August 2011 - Posts

Last night… was shock to see some of my groups are been shifted \ landed up into wrong OUs in my Active Directory.

I have approx 300 over OUs and there are just so many groups to be moved back to their respective OU…


This is where powershell cmdlet comes in handle! Imagine using vbscripts… Yes, we can do it. But the script needs to be modify and it is quite lengthy~

In my environment, I am using Quest AD Cmdlet… I find it easier to use. Just imagine, for vbscript, you will need to comb through the whole AD for the user-group and compare before you know where to move it to. For powershell, you just need one line as there is a ready cmdlet that does what I want!!


Here is the command I use..

Get-QADObject <Group Name> -type Group | Move-QADObject –to <FQDN of Domain>/OU_01_LEVEL/OU_02_LEVEL

<Group Name> – just state the group you want to move.

For my case, I am looking for group that starts with site code “ABCD_”

My Command will be:

Get-QADObject ABCD`_* -type Group | Move-QADObject –to tanchee.panda.local/OU_01_LEVEL/OU_02_LEVEL

This command will search the whole domain for group that is like “ABCD_Tan”, “ABCD_Chee” and “ABCD_PAN” and move the Group to the target site “tanchee.panda.local/OU_01_LEVEL/OU_02_LEVEL”

Cool, right?

So… is there anything stopping you as a AD administrator from learning powershell? STOP THINKING AND GIVING YOURSELF REASON… START LEARNING AND START PLAYING WITH POWERSHELL!

Tested working in 2008 R2 and 2003 AD environment.

Link to download quest powershell cmdlet (free) for active directory.

Posted by zine | with no comments

Was busy writing powershell script and met some issue… Troubleshoot for a while and wonder what went wrong till I look carefully on what I was using… We had a good laugh in the end… I went to use Single Quote as Escape Character instead of the Back Quote.. LOL~

So, I think I will share this information with you all~ And to remind myself of my silly mistake…

Quick Summary

Escape character for Powershell is back quote - “ ` ” The button beside on the left of  “1” on the Keyboard (My Laptop).

Just in case you are not sure where is the Single Quote is “ ‘ ” - The button beside on the left of the “Enter” button on the Keyboard.

One good Website to Share

The website has good example to explain to you when to use double quote and single quote too! Good one!

So, Happy Reading and Scripting!! Smile

Posted by zine | with no comments