//
you're reading...
Active Directory, Powershell, Scripting, Windows Server

How to add Quest AD tools to your native PowerShell


Okay so I got the AD cmdlets working in the standard install of Powershell.  I didn’t want to use the Quest PowerShell command line interface, that’s just me though.  Also, it’ll be easier to run scheduled scripts through the native anyway.

The first thing you need to do is install Windows PowerShell.  I’m using the new CTP 2.0 because of it’s remote capabilities and it comes with a nice GUI scripting interface as well which color codes everything.

http://www.microsoft.com/downloads/details.aspx?FamilyID=60deac2b-975b-41e6-9fa0-c2fd6aa6bc89&displaylang=en

You need to install .NET 2.0 and I think .NET 3.0 as well.  I have both so it didn’t really matter.  You also need to install WS-Management which you can get here.

http://www.microsoft.com/downloads/details.aspx?FamilyId=845289CA-16CC-4C73-8934-DD46B5ED1D33&displaylang=en

Now download and install the AD Quest tools, these are FREE by the way.  This also gives you another PowerShell command line window.  Too many command line windows hence the reason for this blog post.

http://www.quest.com/powershell/activeroles-server.aspx

Now it’s time to create your PowerShell profiles.  The first thing you want to do is open up the PowerShell command line editor and run the following

test-path $profile

This will tell you if you have a personal PowerShell profile.  A profile runs when you launch PowerShell so you can customize.

So, lets’ create one, run this PowerShell line

new-item -path $profile -itemtype file -force

Now type

notepad $profile

This will open your personal PowerShell launch profile.  This is where you can add the Quest AD tools to open with your native PowerShell.  Add the following to the .ps1 file and save.

add-pssnapin quest.activeroles.admanagement

Now close out of PowerShell and open again, you should now have the Quest AD snap-ins in  your PowerShell.  To test, run

get-pssnapins

Now if you really want to get fancy and allow all your PowerShell tools to load these snappins you can remove the add-psssnapin from your profile above and add it to the systems profile.  To do this open up PowerShell and run this line.

new-item -path $env:windir\System32\WindowsPowerShell\v1.0\profile.ps1 -itemtype file -force

This will create a system profile, this will launch for anyone and for any interface on that system.  Now edit the newly created .ps1 file in the SYS32 location above with

 add-pssnapin quest.activeroles.admanagement

You’re now good to go.  These AD Quest tools are great, no more long WMI scripts with these.  Enjoy!

Advertisement

Discussion

Trackbacks/Pingbacks

  1. Pingback: Get the latest Quest AD snappins for PowerShell « Desktop Feedbag - August 12, 2009

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 )

Connecting to %s

%d bloggers like this: