Sign in to follow this  
Followers 0
lgvlgv

[SOLVED] what would u use to find out remote OS?

5 posts in this topic

#1 ·  Posted (edited)

What approch would u use to find out what OS a remote computer is running on?

I guess there are som easy way to detect that even if i havent found it yet.

//Regards Lasse

Edited by lgvlgv

Share this post


Link to post
Share on other sites



It depends on your environment. If you have Active Directory you can query the AD for the OS information of the domain member.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

i was more thinking of a workgroup enviroment, and i also have an local admin account on remote WS.

Share this post


Link to post
Share on other sites

WMI is your friend. I was using Scriptomatic (for download please search the Example Scripts section) to generate the following code:

; Generated by AutoIt Scriptomatic

$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"

$Output=""
$Output = $Output & "Computer: " & $strComputer  & @CRLF
$Output = $Output & "==========================================" & @CRLF
$objWMIService = ObjGet("winmgmts:" & $strComputer & "")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL", _
                                          $wbemFlagReturnImmediately + $wbemFlagForwardOnly)

If IsObj($colItems) then
   For $objItem In $colItems
      $Output = $Output & "BootDevice: " & $objItem.BootDevice & @CRLF
      $Output = $Output & "BuildNumber: " & $objItem.BuildNumber & @CRLF
      $Output = $Output & "BuildType: " & $objItem.BuildType & @CRLF
      $Output = $Output & "Caption: " & $objItem.Caption & @CRLF
      $Output = $Output & "CodeSet: " & $objItem.CodeSet & @CRLF
      $Output = $Output & "CountryCode: " & $objItem.CountryCode & @CRLF
      $Output = $Output & "CreationClassName: " & $objItem.CreationClassName & @CRLF
      $Output = $Output & "CSCreationClassName: " & $objItem.CSCreationClassName & @CRLF
      $Output = $Output & "CSDVersion: " & $objItem.CSDVersion & @CRLF
      $Output = $Output & "CSName: " & $objItem.CSName & @CRLF
      $Output = $Output & "CurrentTimeZone: " & $objItem.CurrentTimeZone & @CRLF
      $Output = $Output & "DataExecutionPrevention_32BitApplications: " & $objItem.DataExecutionPrevention_32BitApplications & @CRLF
      $Output = $Output & "DataExecutionPrevention_Available: " & $objItem.DataExecutionPrevention_Available & @CRLF
      $Output = $Output & "DataExecutionPrevention_Drivers: " & $objItem.DataExecutionPrevention_Drivers & @CRLF
      $Output = $Output & "DataExecutionPrevention_SupportPolicy: " & $objItem.DataExecutionPrevention_SupportPolicy & @CRLF
      $Output = $Output & "Debug: " & $objItem.Debug & @CRLF
      $Output = $Output & "Description: " & $objItem.Description & @CRLF
      $Output = $Output & "Distributed: " & $objItem.Distributed & @CRLF
      $Output = $Output & "EncryptionLevel: " & $objItem.EncryptionLevel & @CRLF
      $Output = $Output & "ForegroundApplicationBoost: " & $objItem.ForegroundApplicationBoost & @CRLF
      $Output = $Output & "FreePhysicalMemory: " & $objItem.FreePhysicalMemory & @CRLF
      $Output = $Output & "FreeSpaceInPagingFiles: " & $objItem.FreeSpaceInPagingFiles & @CRLF
      $Output = $Output & "FreeVirtualMemory: " & $objItem.FreeVirtualMemory & @CRLF
      $Output = $Output & "InstallDate: " & WMIDateStringToDate($objItem.InstallDate) & @CRLF
      $Output = $Output & "LargeSystemCache: " & $objItem.LargeSystemCache & @CRLF
      $Output = $Output & "LastBootUpTime: " & WMIDateStringToDate($objItem.LastBootUpTime) & @CRLF
      $Output = $Output & "LocalDateTime: " & WMIDateStringToDate($objItem.LocalDateTime) & @CRLF
      $Output = $Output & "Locale: " & $objItem.Locale & @CRLF
      $Output = $Output & "Manufacturer: " & $objItem.Manufacturer & @CRLF
      $Output = $Output & "MaxNumberOfProcesses: " & $objItem.MaxNumberOfProcesses & @CRLF
      $Output = $Output & "MaxProcessMemorySize: " & $objItem.MaxProcessMemorySize & @CRLF
      $strMUILanguages = $objItem.MUILanguages(0)
      $Output = $Output & "MUILanguages: " & $strMUILanguages & @CRLF
      $Output = $Output & "Name: " & $objItem.Name & @CRLF
      $Output = $Output & "NumberOfLicensedUsers: " & $objItem.NumberOfLicensedUsers & @CRLF
      $Output = $Output & "NumberOfProcesses: " & $objItem.NumberOfProcesses & @CRLF
      $Output = $Output & "NumberOfUsers: " & $objItem.NumberOfUsers & @CRLF
      $Output = $Output & "OperatingSystemSKU: " & $objItem.OperatingSystemSKU & @CRLF
      $Output = $Output & "Organization: " & $objItem.Organization & @CRLF
      $Output = $Output & "OSArchitecture: " & $objItem.OSArchitecture & @CRLF
      $Output = $Output & "OSLanguage: " & $objItem.OSLanguage & @CRLF
      $Output = $Output & "OSProductSuite: " & $objItem.OSProductSuite & @CRLF
      $Output = $Output & "OSType: " & $objItem.OSType & @CRLF
      $Output = $Output & "OtherTypeDescription: " & $objItem.OtherTypeDescription & @CRLF
      $Output = $Output & "PAEEnabled: " & $objItem.PAEEnabled & @CRLF
      $Output = $Output & "PlusProductID: " & $objItem.PlusProductID & @CRLF
      $Output = $Output & "PlusVersionNumber: " & $objItem.PlusVersionNumber & @CRLF
      $Output = $Output & "Primary: " & $objItem.Primary & @CRLF
      $Output = $Output & "ProductType: " & $objItem.ProductType & @CRLF
      $Output = $Output & "RegisteredUser: " & $objItem.RegisteredUser & @CRLF
      $Output = $Output & "SerialNumber: " & $objItem.SerialNumber & @CRLF
      $Output = $Output & "ServicePackMajorVersion: " & $objItem.ServicePackMajorVersion & @CRLF
      $Output = $Output & "ServicePackMinorVersion: " & $objItem.ServicePackMinorVersion & @CRLF
      $Output = $Output & "SizeStoredInPagingFiles: " & $objItem.SizeStoredInPagingFiles & @CRLF
      $Output = $Output & "Status: " & $objItem.Status & @CRLF
      $Output = $Output & "SuiteMask: " & $objItem.SuiteMask & @CRLF
      $Output = $Output & "SystemDevice: " & $objItem.SystemDevice & @CRLF
      $Output = $Output & "SystemDirectory: " & $objItem.SystemDirectory & @CRLF
      $Output = $Output & "SystemDrive: " & $objItem.SystemDrive & @CRLF
      $Output = $Output & "TotalSwapSpaceSize: " & $objItem.TotalSwapSpaceSize & @CRLF
      $Output = $Output & "TotalVirtualMemorySize: " & $objItem.TotalVirtualMemorySize & @CRLF
      $Output = $Output & "TotalVisibleMemorySize: " & $objItem.TotalVisibleMemorySize & @CRLF
      $Output = $Output & "Version: " & $objItem.Version & @CRLF
      $Output = $Output & "WindowsDirectory: " & $objItem.WindowsDirectory & @CRLF
      if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop
      $Output=""
   Next
Else
   Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_OperatingSystem" )
Endif


Func WMIDateStringToDate($dtmDate)

    Return (StringMid($dtmDate, 5, 2) & "/" & _
    StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _
    & " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate,13, 2))
EndFunc

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

i will, thx very mutch for the help, now i have something to play with :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0