Getting all services and processes

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

This topic contains 1 reply, has 2 voices, and was last updated by

 
Senior Moderator
1 week, 5 days ago.

  • Author
    Posts
  • #165301

    Participant
    Topics: 5
    Replies: 4
    Points: 94
    Rank: Member

    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: 963
    Points: 3,065
    Helping Hand
    Rank: Community Hero

You must be logged in to reply to this topic.