none
GPO export Laptops and desktop to CSV File

    Question

  • Greetings,

    Is there any way to export out computer listed as laptops or desktop to a csv file?

    Saturday, October 15, 2016 3:31 PM

Answers

  • Hi,
    If you want to export computer accounts from AD, in addition to use group policy, I would suggest you have a try to use script, it is more convenient for me, and you could refer to the suggested script as below to try:
    'List All Computers in AD with the Description field
    https://gallery.technet.microsoft.com/scriptcenter/0cb4aae4-5c4b-46c3-bcc6-2a54a595b294
    Inventorying Computers with AD PowerShell
    https://blogs.technet.microsoft.com/askds/2010/02/04/inventorying-computers-with-ad-powershell/
    Best regards,
    Wendy

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, October 17, 2016 3:22 AM
    Moderator
  • @Happywilli,

    Knowing the purpose for which you want the CSV file would help narrrow recommendations.  If you wish to apply group policy by laptop or desktop, one way is with WMI filtering.  A key advantage of WMI filtering is dynamic results, with little management overhead compared to maintaining inventory lists and updating script files.

    A three step process in Powershell will get you a CSV file with close to the results you wish:

    1. Obtain a list of all computers in the forest, Powershell and the Active Directory cmdlets can help here.
    2. Process that list with Get-CIMInstance and the WMI class Win32ComputerSystem and process the Property PCSystemType or PCSystemTypeEX for desktop or mobile values
    3. Output the results of the query to a csv file.

    To utilize WMI filtering use the criteria in the filter that you develop in step 2, in the GPO filter.

    It pays to spend time optimizing the query to return the minimum amount of information using the Get-CIMInstance cmdlet and supplying a WMI filter to reduce the results to the minimum

    Not all systems populate those WMI class values correctly.  BIOS updates and/or testing of other properties returned by Win32_ComputerSystem should be considered to resolve ambiguities.

    HTH,

    TomS

    Monday, October 17, 2016 7:01 PM

All replies

  • Hi,
    If you want to export computer accounts from AD, in addition to use group policy, I would suggest you have a try to use script, it is more convenient for me, and you could refer to the suggested script as below to try:
    'List All Computers in AD with the Description field
    https://gallery.technet.microsoft.com/scriptcenter/0cb4aae4-5c4b-46c3-bcc6-2a54a595b294
    Inventorying Computers with AD PowerShell
    https://blogs.technet.microsoft.com/askds/2010/02/04/inventorying-computers-with-ad-powershell/
    Best regards,
    Wendy

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, October 17, 2016 3:22 AM
    Moderator
  • @Happywilli,

    Knowing the purpose for which you want the CSV file would help narrrow recommendations.  If you wish to apply group policy by laptop or desktop, one way is with WMI filtering.  A key advantage of WMI filtering is dynamic results, with little management overhead compared to maintaining inventory lists and updating script files.

    A three step process in Powershell will get you a CSV file with close to the results you wish:

    1. Obtain a list of all computers in the forest, Powershell and the Active Directory cmdlets can help here.
    2. Process that list with Get-CIMInstance and the WMI class Win32ComputerSystem and process the Property PCSystemType or PCSystemTypeEX for desktop or mobile values
    3. Output the results of the query to a csv file.

    To utilize WMI filtering use the criteria in the filter that you develop in step 2, in the GPO filter.

    It pays to spend time optimizing the query to return the minimum amount of information using the Get-CIMInstance cmdlet and supplying a WMI filter to reduce the results to the minimum

    Not all systems populate those WMI class values correctly.  BIOS updates and/or testing of other properties returned by Win32_ComputerSystem should be considered to resolve ambiguities.

    HTH,

    TomS

    Monday, October 17, 2016 7:01 PM
  • Hi,

    I am checking how the issue going, if you still have any questions, please feel free to contact us.

    Appreciate for your feedback.

    Best regards,

    Wendy


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, October 21, 2016 9:01 AM
    Moderator