none
Pulling in software serial # from computers in a domain from registry useing Powershell

    Question

  • Hi all,

    I am looking into a way to Pull in software serial # from computers in a domain from registry useing Powershell.  I have a list of about 150 computers that have Autocad/autodesk installed.

    I also have a list of registry keys locations that contain the serial #.  It would be nice to have the serial # listed besides the associated computer.  Below is a sample of the Registry keys.

    AutoCAD 2010

    HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R18.0\ACAD-8001:409

    AutoCAD 2009

    HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R17.2\ACAD-7001:409

    AutoCAD 2008

    HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R17.1\ACAD-6001:409

    AutoCAD 2007

    HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R17.0\ACAD-5001:409

       

    AutoCAD LT 2007

    HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD LT\R12\ACADLT-5001:409

    Thursday, June 23, 2011 1:27 PM

Answers

  • Hi,

     

     

    You can use the “new-itemproperty” or “set-itemproperty” to change the registry key.

     

     

    For example:

     

    new-itemproperty -path hkcu:\environment -name PSTest -value 1 -propertyType dword

     

    set-itemproperty -path hkcu:\environment -name PSTest -value Start -type string

     

     

    Meanwhile, you can use the “Invoke-Command” to manage the remote machines.

     

    For more information:

    http://technet.microsoft.com/en-us/library/dd347578.aspx

     

     

     

     

    Thanks.

    Friday, June 24, 2011 8:39 AM
    Moderator
  • You could download this PowerShell module PSRemoteRegistry:  http://archive.msdn.microsoft.com/PSRemoteRegistry/Release/ProjectReleases.aspx?ReleaseId=3781  (you'll need to run PowerShell "As Administrator" to use this module.

    Once you have the module installed, this should be close to what you need:

    function Get-AutoCADKey ($path) {

        Import-Module PSRemoteRegistry   
        $results = @()

        Get-Content $path | foreach {

            $key = Get-RegKey -ComputerName $_ -Key SOFTWARE\Autodesk\AutoCAD -Name ACAD-* -Recurse | Get-RegValue
           
      $results += New-Object PSObject -Property @{

       ComputerName = $_
       SerialNumber = $key.data

       }
       
      }
      
     $results
      
    }

     

    It should pull in your list of computer names, loop through them retrieving the key value, then add an object representing the computer name and serial number to an array. You should be able to pipe the resulting array of objects directly into other cmdlets like Out-File or Export-Csv.

    Then you can run it against your list of server names:

     

    Get-AutoCadKey -Path "C:\PathTo\MyComputer\List.txt" | Export-Csv "C:\results.csv" -NoTypeInformation

     

    I haven't tested this because I dont' have autoCAD but it's my best quick effort. There is no error handling but it should get you started and I believe this answers your question.

    Good luck!

    -Dan

     

     

     

    Sunday, June 26, 2011 2:38 AM

All replies

  • Hi,

     

     

    You can use the “new-itemproperty” or “set-itemproperty” to change the registry key.

     

     

    For example:

     

    new-itemproperty -path hkcu:\environment -name PSTest -value 1 -propertyType dword

     

    set-itemproperty -path hkcu:\environment -name PSTest -value Start -type string

     

     

    Meanwhile, you can use the “Invoke-Command” to manage the remote machines.

     

    For more information:

    http://technet.microsoft.com/en-us/library/dd347578.aspx

     

     

     

     

    Thanks.

    Friday, June 24, 2011 8:39 AM
    Moderator
  • You could download this PowerShell module PSRemoteRegistry:  http://archive.msdn.microsoft.com/PSRemoteRegistry/Release/ProjectReleases.aspx?ReleaseId=3781  (you'll need to run PowerShell "As Administrator" to use this module.

    Once you have the module installed, this should be close to what you need:

    function Get-AutoCADKey ($path) {

        Import-Module PSRemoteRegistry   
        $results = @()

        Get-Content $path | foreach {

            $key = Get-RegKey -ComputerName $_ -Key SOFTWARE\Autodesk\AutoCAD -Name ACAD-* -Recurse | Get-RegValue
           
      $results += New-Object PSObject -Property @{

       ComputerName = $_
       SerialNumber = $key.data

       }
       
      }
      
     $results
      
    }

     

    It should pull in your list of computer names, loop through them retrieving the key value, then add an object representing the computer name and serial number to an array. You should be able to pipe the resulting array of objects directly into other cmdlets like Out-File or Export-Csv.

    Then you can run it against your list of server names:

     

    Get-AutoCadKey -Path "C:\PathTo\MyComputer\List.txt" | Export-Csv "C:\results.csv" -NoTypeInformation

     

    I haven't tested this because I dont' have autoCAD but it's my best quick effort. There is no error handling but it should get you started and I believe this answers your question.

    Good luck!

    -Dan

     

     

     

    Sunday, June 26, 2011 2:38 AM