Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Quest PowerShell  used to get services

Posted on 2012-04-13
8
Medium Priority
?
496 Views
Last Modified: 2012-04-18
WE do not have 2008r2 DC's nor do we have active directory web installed.  I'm trying to use Quest tools with native powershell to pull some reports.

I need to obtain all services running on computers in a specific OU.

Get-QADComputer -SearchRoot 'OU=App,OU=Servers,DC=xxxx,DC=xxx,DC=xxx' | Get-Service

When i run this it does not work.  

Thanks
0
Comment
Question by:niaidsdt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 6

Expert Comment

by:slidingfox
ID: 37843245
Try this.

$computers = Get-QADComputer -SearchRoot 'OU=App,OU=Servers,DC=xxxx,DC=xxx,DC=xxx' | Select -expand Name

$computers | Get-Service

Open in new window

0
 
LVL 6

Expert Comment

by:slidingfox
ID: 37843253
Ignore me, thats rubbish and it won't work. I'll have something else shortly.
0
 

Author Comment

by:niaidsdt
ID: 37843305
YOu put me on the right track

cls
$computers = Get-QADComputer -SearchRoot 'OU=Test,OU=Servers,DC=xxx,DC=xx,DC=xxx'

foreach ($computers1 in $computers)
{
Get-Service
}
0
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 6

Assisted Solution

by:slidingfox
slidingfox earned 800 total points
ID: 37843321
Yeah, thats pretty much what I came up with.

$computers = Get-QADComputer -SearchRoot 'OU=App,OU=Servers,DC=xxxx,DC=xxx,DC=xxx' | Select -Expand Name

Foreach ($computer in $computers) {

    Get-Service -Computername $computer | 
        Add-Member -MemberType NoteProperty -Name Computer -Value $Computer -passthru | 
        Select Computer,Status,Name,DisplayName | 
        Format-Table -auto
    
}

Open in new window

0
 

Author Comment

by:niaidsdt
ID: 37843372
Cool.  Any way to ouput the account the service is running under?
0
 

Author Comment

by:niaidsdt
ID: 37843559
looks like the get-service doesn't have the smarts to figure out all information about the services running.  Ended up having to use


   Get-WmiObject win32_service -ComputerName $computer |
   select SystemName,DisplayName,StartName |
   Format-Table -auto
0
 

Accepted Solution

by:
niaidsdt earned 0 total points
ID: 37843972
Ended up using this one

cls
##      On Error continue
"$ErrorActionPreference = silentlyContinue"
$log = 'C:\Log\services.txt'
$computers = Get-QADComputer -SearchRoot 'ou=servers,DC=xx,DC=xx,DC=xx' | Select -Expand Name

Foreach ($computer in $computers)
{

   Get-WmiObject win32_service -ComputerName $computer |
   select SystemName,DisplayName,StartName |
   
   Format-Table -auto >> $log  
}
0
 

Author Closing Comment

by:niaidsdt
ID: 37859714
Script i created gave me exactly what i was looking for.  <br /><br />slidingfox definitely put me on the right track and it was much appreciated.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question