Welcome to Powergui.org - an open source community for Windows Powershell

PowerGUI.org PowerGUI.org and blogs

Forums » Active Directory and PowerShell

Thread: connect-qadservice which DC ?

This question is answered.


Permlink Replies: 10 - Pages: 1 - Last Post: Nov 23, 2009 9:30 AM by: Paul Chavez
Steve_J

Posts: 6
Registered: 9/11/09
connect-qadservice which DC ?
Posted: Nov 20, 2009 12:55 PM
 
  Click to reply to this thread Reply



if I run
$conn = connect-qadservice -service domain.com
$conn

I get the connection but how do find which actual DC is being connected to?

Thanks,
Steve---



Paul Chavez

Posts: 178
Registered: 9/3/08
Re: connect-qadservice which DC ?
Posted: Nov 20, 2009 2:30 PM   in response to: Steve_J
Helpful
  Click to reply to this thread Reply

$conn.Directory.ServerName

OR, if you didn't save to variable it'll be in the $QADConnection session variable.

And in the spirit of 'teach a man to fish' I figured this out by inspecting the $conn variable.

First:
$conn | fl *

This showed a Directory property that looked interesting, then I ran:
$conn.Directory | fl *

However, if you do the same you'll notice other tasty properties wrapped up in custom Quest object that may be interesting.




Message was edited by: Paul Chavez


Steve_J

Posts: 6
Registered: 9/11/09
Re: connect-qadservice which DC ?
Posted: Nov 23, 2009 4:50 AM   in response to: Paul Chavez
 
  Click to reply to this thread Reply

I don't get "directory" listed as a property. 

here's my output:


[PS] C:\>$conn = Connect-QADService -Service 'mercer.com'
[PS] C:\>$conn | fl *


Type                       : ActiveDirectory
TerminalServicesProperties : {TsBrokenConnectionAction, TsAllowLogon, TsReconnectionAction, TsEnableRemoteControl...}
Domain                     : mercer.com
Parameters                 : Quest.ActiveRoles.ArsPowerShellSnapIn.ConnectionParameters
RootDSE                    : rootDSE
BindFlags                  : Secure, Signing, Sealing, ServerBind
Schema                     : Quest.ActiveRoles.ArsPowerShellSnapIn.Data.ArsDirectorySchema
DefaultNamingContext       : DC=mercer,DC=com
ConfigurationNamingContext : CN=Configuration,DC=mercerinc,DC=com

I've also gone through and inspected these and wasn't able to find the DC I was connected to.

do I need another library loaded or something? 
also I'm on XP sp3, .NET 3.5, QAD 1.1, powergui 1.9




Shay Levy


Posts: 1,919
Registered: 1/31/08
Re: connect-qadservice which DC ?
Posted: Nov 23, 2009 5:25 AM   in response to: Steve_J
 
  Click to reply to this thread Reply

$conn.RootDSE.Path

Shay Levy [MVP]
http://blogs.microsoft.co.il/blogs/ScriptFanatic
PowerShell Toolbar
Steve_J

Posts: 6
Registered: 9/11/09
Re: connect-qadservice which DC ?
Posted: Nov 23, 2009 5:34 AM   in response to: Shay Levy
 
  Click to reply to this thread Reply

that returns


[PS] C:\>$conn.RootDSE.path
LDAP://mercer.com/rootDSE

I'm trying to get the actual domain controller



Shay Levy


Posts: 1,919
Registered: 1/31/08
Re: connect-qadservice which DC ?
Posted: Nov 23, 2009 5:53 AM   in response to: Steve_J
Answered
  Click to reply to this thread Reply

Hmm... I get (using v1.3):

LDAP://dc1.domain.com/rootDSE

Shay Levy [MVP]
http://blogs.microsoft.co.il/blogs/ScriptFanatic
PowerShell Toolbar
Steve_J

Posts: 6
Registered: 9/11/09
Re: connect-qadservice which DC ?
Posted: Nov 23, 2009 6:15 AM   in response to: Shay Levy
 
  Click to reply to this thread Reply

that did it,  upgrading to 1.3

Thanks,
greatly appreciated.



Shay Levy


Posts: 1,919
Registered: 1/31/08
Re: connect-qadservice which DC ?
Posted: Nov 23, 2009 7:11 AM   in response to: Steve_J
 
  Click to reply to this thread Reply

Great :)

Shay Levy [MVP]
http://blogs.microsoft.co.il/blogs/ScriptFanatic
PowerShell Toolbar
Paul Chavez

Posts: 178
Registered: 9/3/08
Re: connect-qadservice which DC ?
Posted: Nov 23, 2009 8:58 AM   in response to: Shay Levy
 
  Click to reply to this thread Reply

How do you check QAD cmdlet versions?





Shay Levy


Posts: 1,919
Registered: 1/31/08
Re: connect-qadservice which DC ?
Posted: Nov 23, 2009 9:14 AM   in response to: Paul Chavez
 
  Click to reply to this thread Reply

Get-PSSnapin Quest.ActiveRoles.ADManagement | Select-Object Version

Shay Levy [MVP]
http://blogs.microsoft.co.il/blogs/ScriptFanatic
PowerShell Toolbar
Paul Chavez

Posts: 178
Registered: 9/3/08
Re: connect-qadservice which DC ?
Posted: Nov 23, 2009 9:30 AM   in response to: Shay Levy
 
  Click to reply to this thread Reply

Thanks, Shay.

I'm running 1.2.2.1254.





Legend
MVP: 2501 + pts
Guru: 2001 - 2500 pts
Expert: 751 - 2000 pts
Enthusiast: 31 - 750 pts
Novice: 0 - 30 pts
Moderators
Helpful answer (5 pts)
Answered (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums