![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #2 (permalink) |
| Guest | RE: Listing all objects in an ADSI OU $ou = [ADSI]"LDAP://OU=Workstations,DC=starking,DC=org" foreach ($child in $ou.psbase.Children ) { if ($child.ObjectCategory -like '*computer*'){Write-Host $child.distinguishedname } } -- Richard Siddaway Please note that all scripts are supplied "as is" and with no warranty Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "techjohnny@gmail.com" wrote: > I'm trying to pull a list of computers from an OU in AD. I know to > use the [ADSI] object, but can't figure out where to go from there. > I'd like to use this list of computers to -filter for 1-process on all > computers. > > Thanks, > > --TJ > > |
| | #3 (permalink) |
| Guest | Re: Listing all objects in an ADSI OU How can I string everything but the computername? --TJ On May 30, 11:53 am, RichS <R...@discussions.microsoft.com> wrote: > $ou = [ADSI]"LDAP://OU=Workstations,DC=starking,DC=org" > foreach ($child in $ou.psbase.Children ) > { > if ($child.ObjectCategory -like '*computer*'){Write-Host > $child.distinguishedname } > > } > > -- > Richard Siddaway > Please note that all scripts are supplied "as is" and with no warranty > Blog:http://richardsiddaway.spaces.live.com/ > PowerShell User Group:http://www.get-psuguk.org.uk > > > > "techjoh...@gmail.com" wrote: > > I'm trying to pull a list of computers from an OU in AD. I know to > > use the [ADSI] object, but can't figure out where to go from there. > > I'd like to use this list of computers to -filter for 1-process on all > > computers. > > > Thanks, > > > --TJ- Hide quoted text - > > - Show quoted text - |
| | #4 (permalink) |
| Guest | Re: Listing all objects in an ADSI OU ACtually, I would like to list ONLY the computer names. Thanks, --TJ On May 30, 12:57 pm, "techjoh...@gmail.com" <techjoh...@gmail.com> wrote: > How can I string everything but the computername? > > --TJ > > On May 30, 11:53 am, RichS <R...@discussions.microsoft.com> wrote: > > > > > $ou = [ADSI]"LDAP://OU=Workstations,DC=starking,DC=org" > > foreach ($child in $ou.psbase.Children ) > > { > > if ($child.ObjectCategory -like '*computer*'){Write-Host > > $child.distinguishedname } > > > } > > > -- > > Richard Siddaway > > Please note that all scripts are supplied "as is" and with no warranty > > Blog:http://richardsiddaway.spaces.live.com/ > > PowerShell User Group:http://www.get-psuguk.org.uk > > > "techjoh...@gmail.com" wrote: > > > I'm trying to pull a list of computers from an OU in AD. I know to > > > use the [ADSI] object, but can't figure out where to go from there. > > > I'd like to use this list of computers to -filter for 1-process on all > > > computers. > > > > Thanks, > > > > --TJ- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - |
| | #5 (permalink) |
| Guest | Re: Listing all objects in an ADSI OU Change the script to $ou = [ADSI]"LDAP://OU=Workstations,DC=starking,DC=org" foreach ($child in $ou.psbase.Children ) { if ($child.ObjectCategory -like '*computer*') { Write-Host $child.Name } } -- Richard Siddaway Please note that all scripts are supplied "as is" and with no warranty Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "techjohnny@gmail.com" wrote: > ACtually, I would like to list ONLY the computer names. > > Thanks, > > --TJ > > On May 30, 12:57 pm, "techjoh...@gmail.com" <techjoh...@gmail.com> > wrote: > > How can I string everything but the computername? > > > > --TJ > > > > On May 30, 11:53 am, RichS <R...@discussions.microsoft.com> wrote: > > > > > > > > > $ou = [ADSI]"LDAP://OU=Workstations,DC=starking,DC=org" > > > foreach ($child in $ou.psbase.Children ) > > > { > > > if ($child.ObjectCategory -like '*computer*'){Write-Host > > > $child.distinguishedname } > > > > > } > > > > > -- > > > Richard Siddaway > > > Please note that all scripts are supplied "as is" and with no warranty > > > Blog:http://richardsiddaway.spaces.live.com/ > > > PowerShell User Group:http://www.get-psuguk.org.uk > > > > > "techjoh...@gmail.com" wrote: > > > > I'm trying to pull a list of computers from an OU in AD. I know to > > > > use the [ADSI] object, but can't figure out where to go from there. > > > > I'd like to use this list of computers to -filter for 1-process on all > > > > computers. > > > > > > Thanks, > > > > > > --TJ- Hide quoted text - > > > > > - Show quoted text -- Hide quoted text - > > > > - Show quoted text - > > > |
| | #6 (permalink) |
| Guest | Re: Listing all objects in an ADSI OU Thanks. That worked properly. --TJ On May 30, 1:51 pm, RichS <R...@discussions.microsoft.com> wrote: > Change the script to > > $ou = [ADSI]"LDAP://OU=Workstations,DC=starking,DC=org" > foreach ($child in $ou.psbase.Children ) > { > if ($child.ObjectCategory -like '*computer*') > { > Write-Host $child.Name > > } > } > > -- > Richard Siddaway > Please note that all scripts are supplied "as is" and with no warranty > Blog:http://richardsiddaway.spaces.live.com/ > PowerShell User Group:http://www.get-psuguk.org.uk > > > > "techjoh...@gmail.com" wrote: > > ACtually, I would like to list ONLY the computer names. > > > Thanks, > > > --TJ > > > On May 30, 12:57 pm, "techjoh...@gmail.com" <techjoh...@gmail.com> > > wrote: > > > How can I string everything but the computername? > > > > --TJ > > > > On May 30, 11:53 am, RichS <R...@discussions.microsoft.com> wrote: > > > > > $ou = [ADSI]"LDAP://OU=Workstations,DC=starking,DC=org" > > > > foreach ($child in $ou.psbase.Children ) > > > > { > > > > if ($child.ObjectCategory -like '*computer*'){Write-Host > > > > $child.distinguishedname } > > > > > } > > > > > -- > > > > Richard Siddaway > > > > Please note that all scripts are supplied "as is" and with no warranty > > > > Blog:http://richardsiddaway.spaces.live.com/ > > > > PowerShell User Group:http://www.get-psuguk.org.uk > > > > > "techjoh...@gmail.com" wrote: > > > > > I'm trying to pull a list of computers from an OU in AD. I know to > > > > > use the [ADSI] object, but can't figure out where to go from there. > > > > > I'd like to use this list of computers to -filter for 1-process on all > > > > > computers. > > > > > > Thanks, > > > > > > --TJ- Hide quoted text - > > > > > - Show quoted text -- Hide quoted text - > > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - |
| | #7 (permalink) |
| Dmitry Sotnikov | Or use the AD cmdlets Alternatively you can get the computer list with this AD cmdlet one-liner: Get-QADComputer -SearchRoot ps64.local/TestOU See this post for more OU-related operations: OU Management with PowerShell « Dmitry’s PowerBlog Dmitry Dmitry’s PowerBlog |
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Frustrating ADSI | Stephan Winkler | PowerShell | 9 | 02-12-2007 09:07 AM |
| ADSI Documentation? | Jim Holbach | PowerShell | 3 | 10-15-2006 08:01 PM |
| Trapping and ADSI? | Dan Metzler | PowerShell | 19 | 10-09-2006 01:12 PM |
| [ADSI] Syntax | Chris Warwick | PowerShell | 8 | 09-30-2006 12:13 AM |
| [ADSI] getting COM properties . | /\\/\\o\\/\\/ [MVP] | PowerShell | 0 | 09-29-2006 11:36 AM |