[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 498
  • Last Modified:

Quest PowerShell used to get services

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
niaidsdt
Asked:
niaidsdt
  • 5
  • 3
2 Solutions
 
slidingfoxCommented:
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
 
slidingfoxCommented:
Ignore me, thats rubbish and it won't work. I'll have something else shortly.
0
 
niaidsdtAuthor Commented:
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
New Tabletop Appliances Blow Competitors Away!

WatchGuard’s new T15, T35 and T55 tabletop UTMs provide the highest-performing security inspection in their class, allowing users at small offices, home offices and distributed enterprises to experience blazing-fast Internet speeds without sacrificing enterprise-grade security.

 
slidingfoxCommented:
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
 
niaidsdtAuthor Commented:
Cool.  Any way to ouput the account the service is running under?
0
 
niaidsdtAuthor Commented:
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
 
niaidsdtAuthor Commented:
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
 
niaidsdtAuthor Commented:
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

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now