PowerShell – working in multi domain environment

I find it annoying that there is no easy way of connecting to domains to to use commands such as get-ADuser or get-ADcomputer.
This is were Quest PS Snapin comes in helpful.

Once the snapin is installed to connect to a domainB while working in domainA simply use the Connect-QADService commands – I have scripted it and saved it as: Connect-ToDomain.ps1

$domain = read-host "What domain do you want to connect to"
 Add-PSSnapin Quest.ActiveRoles.ADManagement
 Connect-QADservice $domain

Job Done

Leave a Reply

Your email address will not be published. Required fields are marked *

20 + one =

This site uses Akismet to reduce spam. Learn how your comment data is processed.