Solved

Quest PowerShell  used to get services

Posted on 2012-04-13
8
494 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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 6

Assisted Solution

by:slidingfox
slidingfox earned 200 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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 …
Previously, on our Nano Server Deployment series, we've created a new nano server image and deployed it on a physical server in part 2. Now we will go through configuration.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
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…

738 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