Jump to content

Remote system..


Recommended Posts

MsgBox(0,"OS",OSInfo(@ComputerName))

Func OSInfo($s_Machine)
    Local Const $wbemFlagReturnImmediately = 0x10
    Local Const $wbemFlagForwardOnly = 0x20
   Local $colItems = "", $objItem, $s_info
   Local $objWMIService = ObjGet("winmgmts:\\" & $s_Machine & "\root\CIMV2")
   If @error Then
      MsgBox(16, "_RetieveOSInfo", "ObjGet Error: winmgmts")
      Return
   EndIf
   $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_OperatingSystem", "WQL", _
         $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
   If @error Then
      MsgBox(16, "_RetieveOSInfo", "ExecQuery Error: SELECT * FROM Win32_OperatingSystem")
      Return
   EndIf
   $s_info = "System:" & @CRLF & @TAB
   If IsObj($colItems) Then
      For $objItem In $colItems
         Local $name = StringSplit($objItem.Name, "|")
         $s_info = $s_info & $name[1] & @CRLF & @TAB
         $s_info = $s_info & "Version " & $objItem.Version & @CRLF & @TAB
         $s_info = $s_info & "Service Pack " & $objItem.ServicePackMajorVersion & @CRLF & @CRLF
         $s_info = $s_info & "Registered to:" & @CRLF & @TAB
         $s_info = $s_info & $objItem.RegisteredUser & @CRLF & @TAB
         $s_info = $s_info & $objItem.Organization & @CRLF & @TAB
         $s_info = $s_info & $objItem.SerialNumber & @CRLF & @CRLF
      Next
   EndIf
    Return $s_info
EndFunc

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

MsgBox(0,"OS",OSInfo(@ComputerName))

Func OSInfo($s_Machine)
    Local Const $wbemFlagReturnImmediately = 0x10
    Local Const $wbemFlagForwardOnly = 0x20
   Local $colItems = "", $objItem, $s_info
   Local $objWMIService = ObjGet("winmgmts:\\" & $s_Machine & "\root\CIMV2")
   If @error Then
      MsgBox(16, "_RetieveOSInfo", "ObjGet Error: winmgmts")
      Return
   EndIf
   $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_OperatingSystem", "WQL", _
         $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
   If @error Then
      MsgBox(16, "_RetieveOSInfo", "ExecQuery Error: SELECT * FROM Win32_OperatingSystem")
      Return
   EndIf
   $s_info = "System:" & @CRLF & @TAB
   If IsObj($colItems) Then
      For $objItem In $colItems
         Local $name = StringSplit($objItem.Name, "|")
         $s_info = $s_info & $name[1] & @CRLF & @TAB
         $s_info = $s_info & "Version " & $objItem.Version & @CRLF & @TAB
         $s_info = $s_info & "Service Pack " & $objItem.ServicePackMajorVersion & @CRLF & @CRLF
         $s_info = $s_info & "Registered to:" & @CRLF & @TAB
         $s_info = $s_info & $objItem.RegisteredUser & @CRLF & @TAB
         $s_info = $s_info & $objItem.Organization & @CRLF & @TAB
         $s_info = $s_info & $objItem.SerialNumber & @CRLF & @CRLF
      Next
   EndIf
    Return $s_info
EndFunc
This script is working fine...

IS there is any other way to find OS type without use of WMI...

As to run above script sucessfully remote system admin access is required... and for the network having diffrent local admin passwords its hard to run it....

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...