This is a question which comes from time to time: how do you make the AD cmdlets work against a particular Domain Controller?
As you probably know you don’t actually need to explicitly connect to a DC to run the cmdlets. If you need a list of users in your domain you just install the cmdlets and run
Get-QADUser. This PowerShell cmdlet just runs against the closest DC of the current domain and retrieves the data.
However, what happens if your workstation is not a part of the domain? Or if you are managing a multi-domain/multi-forest environment and want to connect to a different domain than the one in which you are?
In that case the
Connect-QADService cmdlet comes really handy. You just run:
Connect-QADService -service 'server.company.com'
And you are connected to that specific domain controller for all subsequent cmdets.