![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #11 (permalink) |
| | RE: Quest AD help or more simply if using quest ad snapins Get-QADUser | where {$_.memberof -match "Desired Group Name"} | fl givenname,sn,DisplayName,mail "Ian_1" wrote: Quote: > What is with "(cn=*Picard)" -- Im not looking for any certian user, but I > tried it both with it and without it for us. I need a list of users in a .CSV > format - firstname, lastname, middle initial, email address.. Thanks > > Here's the error I got Bob: > An error occurred while enumerating through a collection: The > (&(objectClass=user)(cn=*picard) search filter is invalid > .. > At C:\scripts\Ad_Connection2.ps1:4 char:1 > + $ <<<< searcher.findall() | % {$_.path} > > > > > "Bob Landau" wrote: > Quote: > > You are quite correct on both accounts > > > > It is not hard; but I won't say that it's easy unless you are at least some > > what acquainted with the .NET Directory Services classes. > > > > The code I posted did not work I'm not sure why it didn't return an error > > but thats an adventure for another day. > > > > When I cut and pasted my code into the reply I missed the [ADSI] type so the > > constructor never got constructed or should I say the [ADSI] ctor didn't. > > What you got back was a STRING. > > > > Add one very small change > > > > $root = [ADSI] 'LDAP://OU=Enterprise, OU=NextGen DC=Continuum, DC=local' > > $searcher = new-object System.DirectoryServices.DirectorySearcher($root) > > $searcher.filter = "(&(objectClass=user)(cn=*Picard)" > > $searcher.findall() | % {$_.path} > > > > Again you must changes the moniker to reflect your DS namespace. > > > > Here is one other URL which I found using MSN Live it's at the top of the > > list and was one of the pages I used to learn about ADSI > > > > http://www.microsoft.com/technet/tec...l/default.aspx > > > > thx > > bob > > > > "Ian_1" wrote: > > Quote: > > > Sorry, your script doen't not work. I should not have been specific to just > > > Quest. It can be WMI, or .NET, or utilizing the ADSI accelerator, etc, it > > > really doesn't matter. Since this is the point of scripting to make life > > > simple, surely it's as easy as ? (still researching) |
My System Specs![]() |
| | #12 (permalink) |
| | RE: Quest AD help Get-QADUser | where {$_.CanonicalName -match "Desired Group Name"} | fl Quote: > givenname,sn,DisplayName,mail "voodooking" wrote: Quote: > or more simply if using quest ad snapins > > Get-QADUser | where {$_.CanonicalName -match "Desired Group Name"} | fl > givenname,sn,DisplayName,mail > > "Ian_1" wrote: > Quote: > > What is with "(cn=*Picard)" -- Im not looking for any certian user, but I > > tried it both with it and without it for us. I need a list of users in a .CSV > > format - firstname, lastname, middle initial, email address.. Thanks > > > > Here's the error I got Bob: > > An error occurred while enumerating through a collection: The > > (&(objectClass=user)(cn=*picard) search filter is invalid > > .. > > At C:\scripts\Ad_Connection2.ps1:4 char:1 > > + $ <<<< searcher.findall() | % {$_.path} > > > > > > > > > > "Bob Landau" wrote: > > Quote: > > > You are quite correct on both accounts > > > > > > It is not hard; but I won't say that it's easy unless you are at least some > > > what acquainted with the .NET Directory Services classes. > > > > > > The code I posted did not work I'm not sure why it didn't return an error > > > but thats an adventure for another day. > > > > > > When I cut and pasted my code into the reply I missed the [ADSI] type so the > > > constructor never got constructed or should I say the [ADSI] ctor didn't. > > > What you got back was a STRING. > > > > > > Add one very small change > > > > > > $root = [ADSI] 'LDAP://OU=Enterprise, OU=NextGen DC=Continuum, DC=local' > > > $searcher = new-object System.DirectoryServices.DirectorySearcher($root) > > > $searcher.filter = "(&(objectClass=user)(cn=*Picard)" > > > $searcher.findall() | % {$_.path} > > > > > > Again you must changes the moniker to reflect your DS namespace. > > > > > > Here is one other URL which I found using MSN Live it's at the top of the > > > list and was one of the pages I used to learn about ADSI > > > > > > http://www.microsoft.com/technet/tec...l/default.aspx > > > > > > thx > > > bob > > > > > > "Ian_1" wrote: > > > > > > > Sorry, your script doen't not work. I should not have been specific to just > > > > Quest. It can be WMI, or .NET, or utilizing the ADSI accelerator, etc, it > > > > really doesn't matter. Since this is the point of scripting to make life > > > > simple, surely it's as easy as ? (still researching) |
My System Specs![]() |
| | #13 (permalink) |
| | RE: Quest AD help I'm a SciFi addict I can't help it. Hear is how you read the Moniker DC Continuum (a reference to the Q Continuum: my favorite sub-series) DC Local (required for me since I don't have a Internet DNS name) OU Enterprise (a reference to Star Trek Enterprise) OU NextGen (my favorite verion of Enterprise; the original was too much of a Western for me) As I mentioned you need to change the LDAP namespace to reflect the DS in your organization. In regards to the Filter I simply wanted to show to specify a compound filter the syntax is a little different than most people are used to the logical operator must be first. All the filter did was return _only_ Captain Jean-Luc Picard. While you can filter on the client side also it's much more effiecient for the machine that contains the AD to filter the data for you. In your case since you're not looking for a particular individual use "(objectClass=User)" All I've given you is a start. There is more work that you'll need to do I suggest by looking at both $searcher.findall()[0] | get-member $searcher.findall()[0].Properties | get-member. "Ian_1" wrote: Quote: > What is with "(cn=*Picard)" -- Im not looking for any certian user, but I > tried it both with it and without it for us. I need a list of users in a .CSV > format - firstname, lastname, middle initial, email address.. Thanks > > Here's the error I got Bob: > An error occurred while enumerating through a collection: The > (&(objectClass=user)(cn=*picard) search filter is invalid > .. > At C:\scripts\Ad_Connection2.ps1:4 char:1 > + $ <<<< searcher.findall() | % {$_.path} > > > > > "Bob Landau" wrote: > Quote: > > You are quite correct on both accounts > > > > It is not hard; but I won't say that it's easy unless you are at least some > > what acquainted with the .NET Directory Services classes. > > > > The code I posted did not work I'm not sure why it didn't return an error > > but thats an adventure for another day. > > > > When I cut and pasted my code into the reply I missed the [ADSI] type so the > > constructor never got constructed or should I say the [ADSI] ctor didn't. > > What you got back was a STRING. > > > > Add one very small change > > > > $root = [ADSI] 'LDAP://OU=Enterprise, OU=NextGen DC=Continuum, DC=local' > > $searcher = new-object System.DirectoryServices.DirectorySearcher($root) > > $searcher.filter = "(&(objectClass=user)(cn=*Picard)" > > $searcher.findall() | % {$_.path} > > > > Again you must changes the moniker to reflect your DS namespace. > > > > Here is one other URL which I found using MSN Live it's at the top of the > > list and was one of the pages I used to learn about ADSI > > > > http://www.microsoft.com/technet/tec...l/default.aspx > > > > thx > > bob > > > > "Ian_1" wrote: > > Quote: > > > Sorry, your script doen't not work. I should not have been specific to just > > > Quest. It can be WMI, or .NET, or utilizing the ADSI accelerator, etc, it > > > really doesn't matter. Since this is the point of scripting to make life > > > simple, surely it's as easy as ? (still researching) |
My System Specs![]() |
| | #14 (permalink) |
| | RE: Quest AD help "Bob Landau" wrote: Quote: > I'm a SciFi addict I can't help it. Hear is how you read the Moniker > > DC Continuum (a reference to the Q Continuum: my favorite sub-series) > DC Local (required for me since I don't have a Internet DNS name) > OU Enterprise (a reference to Star Trek Enterprise) > OU NextGen (my favorite verion of Enterprise; the original was too much of a > Western for me) > > As I mentioned you need to change the LDAP namespace to reflect the DS in > your organization. > > In regards to the Filter I simply wanted to show to specify a compound > filter the syntax is a little different than most people are used to the > logical operator must be first. > > All the filter did was return _only_ Captain Jean-Luc Picard. While you can > filter on the client side also it's much more effiecient for the machine that > contains the AD to filter the data for you. > > In your case since you're not looking for a particular individual use > > "(objectClass=User)" > > All I've given you is a start. There is more work that you'll need to do I > suggest by looking at both > > $searcher.findall()[0] | get-member > $searcher.findall()[0].Properties | get-member. > > > "Ian_1" wrote: > Quote: > > What is with "(cn=*Picard)" -- Im not looking for any certian user, but I > > tried it both with it and without it for us. I need a list of users in a .CSV > > format - firstname, lastname, middle initial, email address.. Thanks > > > > Here's the error I got Bob: > > An error occurred while enumerating through a collection: The > > (&(objectClass=user)(cn=*picard) search filter is invalid > > .. > > At C:\scripts\Ad_Connection2.ps1:4 char:1 > > + $ <<<< searcher.findall() | % {$_.path} > > > > > > > > > > "Bob Landau" wrote: > > Quote: > > > You are quite correct on both accounts > > > > > > It is not hard; but I won't say that it's easy unless you are at least some > > > what acquainted with the .NET Directory Services classes. > > > > > > The code I posted did not work I'm not sure why it didn't return an error > > > but thats an adventure for another day. > > > > > > When I cut and pasted my code into the reply I missed the [ADSI] type so the > > > constructor never got constructed or should I say the [ADSI] ctor didn't. > > > What you got back was a STRING. > > > > > > Add one very small change > > > > > > $root = [ADSI] 'LDAP://OU=Enterprise, OU=NextGen DC=Continuum, DC=local' > > > $searcher = new-object System.DirectoryServices.DirectorySearcher($root) > > > $searcher.filter = "(&(objectClass=user)(cn=*Picard)" > > > $searcher.findall() | % {$_.path} > > > > > > Again you must changes the moniker to reflect your DS namespace. > > > > > > Here is one other URL which I found using MSN Live it's at the top of the > > > list and was one of the pages I used to learn about ADSI > > > > > > http://www.microsoft.com/technet/tec...l/default.aspx > > > > > > thx > > > bob > > > > > > "Ian_1" wrote: > > > > > > > Sorry, your script doen't not work. I should not have been specific to just > > > > Quest. It can be WMI, or .NET, or utilizing the ADSI accelerator, etc, it > > > > really doesn't matter. Since this is the point of scripting to make life > > > > simple, surely it's as easy as ? (still researching) |
My System Specs![]() |
| | #15 (permalink) |
| | Solved! Ok, something about perspiration is the mother of all.. anyway-- here is the code I finally was able to use to resolve my issue. I used Quest AD cmdlet PS to finally get my list: get-qadgroupmember Accountants | format-table DisplayName,Initials,EMAIL > C:\Accountants.txt Individual attributes can be attained and then formatted like above from: Get-QADUser “Bruce Payette” | Format-List Thank goodness thats over but what fun learning so I can't complain. Thanks to all those who tried to help. It's Miller time! |
My System Specs![]() |
| | #16 (permalink) |
| | RE: Quest AD help simple one liner Get-QADUser | where {$_.CanonicalName -match "Desired Group Name"} | fl givenname,sn,DisplayName,mail if cononical name does not suite your needs run Get-QADUser "logonname for a known user in given group" | fl * | more and scan for appropriate property containing group name possibly ParentContainer and substitue $_.ParentContainer for $_.CanonicalName using -match instead of -eq allows you to use the least complex unique form so for group a group Systems Ifrastructure under group Systems you could use -match "Systems Inf" i assume you can figure out the csv output i am assuming you can figure out the output to csv |
My System Specs![]() |
| | #17 (permalink) |
| | RE: Quest AD help Voodoo, your on a whole other level, none of your stuff works or makes sence to me. "CanonicalName" - lol ok. |
My System Specs![]() |
| | #18 (permalink) |
| | RE: Quest AD help Not sure if you ever found what you were looking for but I got this to work: Get-QADGroupMember "GroupName" | ft givenname,sn,displayname,mail Just subsitute whatever group you want in for GroupName. Example: Get-QADGroupMember "accountants" | ft givenname,sn,displayname,mail Hope that helps. phyler www.nbwheeling.org/~aball "Ian_1" wrote: Quote: > Looking for the Quest PS code to query a group in AD > (LDAP://cn=accountants,ou=city,ou=com) and pull first name, last name, > display, and email address. Im looking while this is posted, just any help > while Im under a deadline would be greatly appreciated. Thank! |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Quest powershell v 1.2 | PowerShell | |||
| How to i add Quest snappins ? | PowerShell | |||
| Quest AD cmdlets RC1 | PowerShell | |||
| Can't add Quest AD cmdlets | PowerShell | |||
| Quest PMC | Vista General | |||