Help exporting list of OS versions for multiple machines using Active Roles Management Shell

Hi all,

Apologies if this is in the wrong place,

I'm very new to Active Roles and have been tasked with obtaining the OS of multiple machines throughout the business.I have the list in a .CSV format and I would like to run a script that will ask Active Roles to check the machines on the list determine what OS they are running and then export it to a new list. Is there any way that can be done. I know it is possible in AD but I have struggled for a way to do it through Active Roles.

If anyone knows of a way it would be very much appreciated.

Kind Regards,

K

Parents
  • Hi 

    There a many ways this data can be gathered, but depends on if it should be initiated from the CSV file or the data source (AD).

    If you initiate from AD (whether via AD or the ARS modules)

    AD:

    $Computers = Get-ADComputer -Properties operatingSystem -filter *
    
    "Computer,OperatingSystem" | Out-File -FilePath "$($env:USERPROFILE)\Desktop\ADComputerObjects.csv"
    ForEach($Computer in $Computers)
    {
        "$($Computer.name),$($Computer.OperatingSystem)" | Out-File -FilePath "$($env:USERPROFILE)\Desktop\ADComputerObjects.csv" -Append
    }

    ARS (to AD):

    $Computers = Get-QADComputer
    
    "Computer,OperatingSystem" | Out-File -FilePath "$($env:USERPROFILE)\Desktop\ARSComputerObjects.csv"
    ForEach($Computer in $Computers)
    {
        "$($Computer.name),$($Computer.OperatingSystem)" | Out-File -FilePath "$($env:USERPROFILE)\Desktop\ARSComputerObjects.csv" -Append
    }

    ARS (to ARS):

    $Computers = Get-QADComputer -proxy
    
    "Computer,OperatingSystem" | Out-File -FilePath "$($env:USERPROFILE)\Desktop\ARSComputerObjects.csv"
    ForEach($Computer in $Computers)
    {
        "$($Computer.name),$($Computer.OperatingSystem)" | Out-File -FilePath "$($env:USERPROFILE)\Desktop\ARSComputerObjects.csv" -Append
    }

    or you create a Managed Unit which includes all computers, the add the columns you want. Then export the content of the Managed unit (using inbuilt functionality in the WI) out to file.

    To do the inverse and query by your CSV, you'd need to 

    1. Read in your CSV file
    2. Search for the Computer in AD/ARS, and retrieve the OS
    3. Write the details out to file.
Reply
  • Hi 

    There a many ways this data can be gathered, but depends on if it should be initiated from the CSV file or the data source (AD).

    If you initiate from AD (whether via AD or the ARS modules)

    AD:

    $Computers = Get-ADComputer -Properties operatingSystem -filter *
    
    "Computer,OperatingSystem" | Out-File -FilePath "$($env:USERPROFILE)\Desktop\ADComputerObjects.csv"
    ForEach($Computer in $Computers)
    {
        "$($Computer.name),$($Computer.OperatingSystem)" | Out-File -FilePath "$($env:USERPROFILE)\Desktop\ADComputerObjects.csv" -Append
    }

    ARS (to AD):

    $Computers = Get-QADComputer
    
    "Computer,OperatingSystem" | Out-File -FilePath "$($env:USERPROFILE)\Desktop\ARSComputerObjects.csv"
    ForEach($Computer in $Computers)
    {
        "$($Computer.name),$($Computer.OperatingSystem)" | Out-File -FilePath "$($env:USERPROFILE)\Desktop\ARSComputerObjects.csv" -Append
    }

    ARS (to ARS):

    $Computers = Get-QADComputer -proxy
    
    "Computer,OperatingSystem" | Out-File -FilePath "$($env:USERPROFILE)\Desktop\ARSComputerObjects.csv"
    ForEach($Computer in $Computers)
    {
        "$($Computer.name),$($Computer.OperatingSystem)" | Out-File -FilePath "$($env:USERPROFILE)\Desktop\ARSComputerObjects.csv" -Append
    }

    or you create a Managed Unit which includes all computers, the add the columns you want. Then export the content of the Managed unit (using inbuilt functionality in the WI) out to file.

    To do the inverse and query by your CSV, you'd need to 

    1. Read in your CSV file
    2. Search for the Computer in AD/ARS, and retrieve the OS
    3. Write the details out to file.
Children
No Data