Windows Vista Forums

RE: Get all Mail-enabled Users from Active Directory using PowerShell
  1. #1


    PaulChavez Guest

    RE: Get all Mail-enabled Users from Active Directory using PowerShell

    What's with the ",domain" hanging off of the end of the LDAP path? Looks like
    that's the problem to me unless I'm forgetting something about how the DN is
    constructed for an LDAP path.

    "Exotic Hadron" wrote:

    >[ADSI]"LDAP://OU=Common,OU=Users,OU=Local,OU=Sites,OU=Russia,OU=Company,DC=internal,DC=local,domain"



      My System SpecsSystem Spec

  2. #2


    Karl Mitschke Guest

    Re: Get all Mail-enabled Users from Active Directory using PowerSh

    Hello Exotic,

    > Of course I did! So what? I am using PoSH 2.0 CTP3 on Windows Server
    > 2008. It applies to Windows Server 2003, PoSH 1 and both the Quest and
    > regular cmdlets.
    >
    > So what he suggests is to use explicit bind. I did that by invoking
    >
    > Connect-QADService -Service 'ourdc'
    >
    > And yes, I did it by authenticating against the Active Directory as
    > well by invoking
    >
    > Connect-QADService -Service 'ourdc' -Credential ( Get-Credential )
    >
    > And nope. This did not help.
    >
    > Am I missing something, Karl? You are speaking in riddles. Could you
    > please say it explicitly what do you suggest?
    >
    > Once again, thank you for helping.
    > "Karl Mitschke" wrote:

    >> Hello Exotic,
    >> Did you read the whole page?
    >> APPLIES TO
    >>
    >> Windows 2003 Active Directory Windows PowerShell 1.0 Both AD cmdlets
    >> and native PowerShell [ADSI] support
    >>
    >> Please try his suggestion and let us know if it fixes your problem.
    >>
    >> Karl
    >>
    I'm not meaning to speak in riddles - all I was doing was attempting to provide
    an answer.

    As you can see, the error is ""An invalid dn syntax has been specified."

    When I go back and review your code, I see that you vave , domain at the
    end of your DN - why is that?

    Remove it, and it should work - works fine for me with my DN.

    Karl



      My System SpecsSystem Spec

  3. #3


    Karl Mitschke Guest

    RE: Get all Mail-enabled Users from Active Directory using PowerShell

    Hello PaulChavez,

    > What's with the ",domain" hanging off of the end of the LDAP path?
    > Looks like that's the problem to me unless I'm forgetting something
    > about how the DN is constructed for an LDAP path.
    >
    > "Exotic Hadron" wrote:
    >

    >> [ADSI]"LDAP://OU=Common,OU=Users,OU=Local,OU=Sites,OU=Russia,OU=Compa
    >> ny,DC=internal,DC=local,domain"
    >>
    I just noticed that too

    I should have better proof read the OP's code.

    karl



      My System SpecsSystem Spec

  4. #4


    Shay Levy [MVP] Guest

    RE: Get all Mail-enabled Users from Active Directory using PowerSh

    Hi Exotic,

    Here's how to get the users with Quest cmdlets:

    Get-QADUser -ldap "(homeMDB=*)" -sizeLimit 0 -ou "OU=Common,OU=Users,OU=Local,OU=Sites,OU=Russia,OU=Company,DC=*internal,DC=local"
    | Format-Table displayName,cn,Email,Name


    ---
    Shay Levy
    Windows PowerShell MVP
    http://blogs.microsoft.co.il/blogs/ScriptFanatic
    PowerShell Toolbar: http://tinyurl.com/PSToolbar



      My System SpecsSystem Spec

RE: Get all Mail-enabled Users from Active Directory using PowerShell problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
SBS users not in Active Directory ron SBS Server 5 13 Aug 2009
Active Directory users shank Server General 3 27 Jul 2009
Script to add computer in Active Directory to all users in an OU jnet77 VB Script 8 07 Nov 2008
Active Directory: getting a list of users Marco Shaw PowerShell 4 04 Jul 2007
Active Directory users and computers snap-in Hooman.B Vista General 4 22 Dec 2006