Getting all services and processes

Welcome Forums General PowerShell Q&A Getting all services and processes

Viewing 2 reply threads
  • Author
    Posts
    • #165301
      Participant
      Topics: 8
      Replies: 7
      Points: 150
      Rank: Participant

      Hi,

      I'm at 9th chapter of Learn windows powershell in a month of lunches and have couple of questions. Could you please help on this?

      1.Trying to get the list of services (without using any parantheses) from an OU. I'm getting error (cannot find any service with service name '@{computername=xyz}') if i dont mention any specific service

      Get-adcomputer -filter * -searchbase 'ou=domain controllers,dc=abc-de,dc=abc,dc=com' | select @{l='computer name';e={$_.name}} | get-service

      But i'm getting results if mention any service like below.

      Get-adcomputer -filter * -searchbase 'ou=domain controllers,dc=abc-de,dc=abc,dc=com' | select @{l='computer name';e={$_.name}} | get-service -name bits

      May i know why the first command is not working and second is working?

      2.Not sure why this below command is working perfectly whereas the first one (getting all services) is not working?

      Get-adcomputer -filter * -searchbase 'ou=domain controllers,dc=abc-de,dc=abc,dc=com' | select @{l='computer name';e={$_.name}} | get-process | export-csv Process.csv

       

       

    • #165397
      Senior Moderator
      Topics: 8
      Replies: 1152
      Points: 4,000
      Helping Hand
      Rank: Community Hero
    • #168655
      Participant
      Topics: 8
      Replies: 7
      Points: 150
      Rank: Participant

      Thank you!

Viewing 2 reply threads
  • The topic ‘Getting all services and processes’ is closed to new replies.