Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6965415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:03:31+00:00 2026-05-27T16:03:31+00:00

I am using Get-WmiObject Win32_service and piping the output to CSV. My script is

  • 0

I am using Get-WmiObject Win32_service and piping the output to CSV.
My script is collecting services running, but I would like to display osname, ip and domain for the object on the same line in my csv (so I can easily sort with Excel).

Is there a way I can combine the two?

Get-WmiObject Win32_Computersystem
Get-WmiObject Win32_service

Or maybe I could sneak in some variables from my Get-QADComputer into this line:

Get-WmiObject Win32_service -Computername $server.name -Filter "State='Running'" | select -Property SystemName,Name,Status,State,Startmode,DisplayName | Export-Csv -Append -NoClobber -NoTypeInformation -Path $reportfile

?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:03:32+00:00Added an answer on May 27, 2026 at 4:03 pm

    Use the New-Object cmdlet to create new object for each service object and add the properties you want (osname) from the Win32_OperatingSystem WMI class (os caption is not avaiable in the Win32_ComputerSystem class).

    $ComputerName = 'PC1'
    
    $os = Get-WmiObject Win32_OperatingSystem -ComputerName $ComputerName
    
    Get-WmiObject Win32_Service -ComputerName $ComputerName -Filter "State='Running'" | Foreach-Object{
    
        New-Object -TypeName PSObject -Property @{
            SystemName=$_.SystemName
            Name=$_.Name
            Status=$_.Status
            State=$_.State
            StartMode=$_.Startmode
            DisplayName=$_.DisplayName
            IPAddress = [System.Net.Dns]::GetHostAddresses($_.SystemName)[0].IPAddressToString
            OSName = $os.Caption            
        } | Select-Object SystemName,Name,Status,State,StartMode,DisplayName,IPAddress,OSName
    
    } | Export-Csv -Append -NoClobber -NoTypeInformation -Path $reportfile
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to use Get-WmiObject Win32_NetworkAdapterConfiguration to return the ip address of a
I'd like to submit a form using GET but without passing the value of
Using get/set seems to be a common practice in Java (for various reasons), but
I have written a CGI script that creates an image dynamically using GET data.
I get a page using file_get_contents from a remote server, but I want to
I'm trying to pass variables using get in php, but ran into a snag.
I have a PHP script that is using get_dns_record to retrieve and display specific
I made a script in PHP which gets a value using get method and
I am using the below script line to get the IP information of system
I am fetching value using jQuery .get() like this $.get('clientarea.php', function(data) { var Val

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.