Jump to content

Admin Tool


GaryFrost
 Share

Recommended Posts

the error is not from the code above...

it is from AdimTools

ok...

maybe you mean the error i am getting is from the code above that was inside Admin tools and you trimmed that code down for your example

if so... the example above errored the same way when i placed the other computer names in it

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

Thanks ;)

I forced one of the tools to error, but stderr didn't get any info

Updated AdminTool, see first post

Gary

That's kind of a disappoinment, but I guess you can test for the string "Error" in the output in any case...

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Link to comment
Share on other sites

Working... Showing All PCs.

But getting same error as posted by VALUATER.

Second thing is don't want to scan Domain. Because it very very Big.. I am concerned only for my Subnet.

I want to scan range of IP ... is it possible???

Originally I had the code traversing the ldap, problem with that is i had to traverse each ou, not sure how to get just a subnet

the domain at work usally has about 2500 to 2700 pcs online at any given time, if my filter is setup up to show all pcs online, doesn't take very long to load the way the program is setup at this time, this is why i created the fuzzy search.

as to the problem your having not sure at this time, need to goto the case statement for $GUI_EVENT_PRIMARYDOWN and comment out the following

_RetrieveAllSoftware ($lv_allsoftware, $s_Machine)

_RetieveOSInfo ($eb_system, $s_Machine)

_RetrieveProcessList ($lv_pid, $s_Machine)

_RetrieveServices ($lv_services, $s_Machine)

_RetrieveLoggedInUsers ($lv_loggedin, $s_Machine)

_DriveInfo ($lv_drives, $s_Machine)

that would only leave two functions when a pc is selected

_GetRole ($s_Machine, $Status)

_RetrieveSoftware ($lv_software, $s_Machine)

if you don't get errors from those functions and it populates the software

then onto the next function, till find what the problem is.

if you get errors from either the GetRole or the _RetrieveSoftware functions, then can narrow the problem down.

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

Originally I had the code traversing the ldap, problem with that is i had to traverse each ou, not sure how to get just a subnet

the domain at work usally has about 2500 to 2700 pcs online at any given time, if my filter is setup up to show all pcs online, doesn't take very long to load the way the program is setup at this time, this is why i created the fuzzy search.

as to the problem your having not sure at this time, need to goto the case statement for $GUI_EVENT_PRIMARYDOWN and comment out the following

_RetrieveAllSoftware ($lv_allsoftware, $s_Machine)

_RetieveOSInfo ($eb_system, $s_Machine)

_RetrieveProcessList ($lv_pid, $s_Machine)

_RetrieveServices ($lv_services, $s_Machine)

_RetrieveLoggedInUsers ($lv_loggedin, $s_Machine)

_DriveInfo ($lv_drives, $s_Machine)

that would only leave two functions when a pc is selected

_GetRole ($s_Machine, $Status)

_RetrieveSoftware ($lv_software, $s_Machine)

if you don't get errors from those functions and it populates the software

then onto the next function, till find what the problem is.

if you get errors from either the GetRole or the _RetrieveSoftware functions, then can narrow the problem down.

Commented out the functions as suggested but keep getting errors on GetRole and can't proceed.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

see where the error is using this code, replace GAF with your pc name

Global Const $wbemFlagReturnImmediately = 0x10
Global Const $wbemFlagForwardOnly = 0x20
$s_pc = "GAF"

Local $objWMIService, $colComputer, $objComputer
$objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $s_pc & "\root\cimv2")
If @error Then
 MsgBox(16, "Unable to retrieve Role", "ObjGet Error: winmgmts")
 Exit
EndIf
$colComputer = $objWMIService.ExecQuery ("Select * from Win32_ComputerSystem", "WQL", _
  $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If @error Then
 MsgBox(16, "Unable to retrieve Role", "Select * from Win32_ComputerSystem")
 Exit
EndIf
For $objComputer In $colComputer
 If Int($objComputer.DomainRole) = 1 Then
  MsgBox(0,"GetRole", $s_pc & " is WorkStation")
 ElseIf Int($objComputer.DomainRole) = 3 Then
  MsgBox(0,"GetRole", $s_pc & " is Server")
 ElseIf Int($objComputer.DomainRole) = 4 Then
  MsgBox(0,"GetRole", $s_pc & " is Backup Domain Controller")
 ElseIf Int($objComputer.DomainRole) = 5 Then
  MsgBox(0,"GetRole", $s_pc & " is Primary Domain Controller")
 Else
  MsgBox(0,"GetRole", "Unable to retrieve Role:" & $s_pc & @LF & $objComputer.DomainRole)
 EndIf
 Exit
Next

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

see where the error is using this code, replace GAF with your pc name

Global Const $wbemFlagReturnImmediately = 0x10
Global Const $wbemFlagForwardOnly = 0x20
$s_pc = "GAF"

Local $objWMIService, $colComputer, $objComputer
$objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $s_pc & "\root\cimv2")
If @error Then
 MsgBox(16, "Unable to retrieve Role", "ObjGet Error: winmgmts")
 Exit
EndIf
$colComputer = $objWMIService.ExecQuery ("Select * from Win32_ComputerSystem", "WQL", _
  $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If @error Then
 MsgBox(16, "Unable to retrieve Role", "Select * from Win32_ComputerSystem")
 Exit
EndIf
For $objComputer In $colComputer
 If Int($objComputer.DomainRole) = 1 Then
  MsgBox(0,"GetRole", $s_pc & " is WorkStation")
 ElseIf Int($objComputer.DomainRole) = 3 Then
  MsgBox(0,"GetRole", $s_pc & " is Server")
 ElseIf Int($objComputer.DomainRole) = 4 Then
  MsgBox(0,"GetRole", $s_pc & " is Backup Domain Controller")
 ElseIf Int($objComputer.DomainRole) = 5 Then
  MsgBox(0,"GetRole", $s_pc & " is Primary Domain Controller")
 Else
  MsgBox(0,"GetRole", "Unable to retrieve Role:" & $s_pc & @LF & $objComputer.DomainRole)
 EndIf
 Exit
Next
Error received is "Unable to retrieve Role" "ObjGet Error: winmgmts"


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

Error received is "Unable to retrieve Role" "ObjGet Error: winmgmts"

I recieve the same error...

@BigDod

this should work on your pc

(Win Xp Home or Pro)

Global Const $wbemFlagReturnImmediately = 0x10
Global Const $wbemFlagForwardOnly = 0x20
$s_Machine = "BLINGBLING"

$objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $s_Machine & "\root\cimv2")
If @error Then
MsgBox(16, "Test wmi", "ObjGet Error: winmgmts")
Exit
EndIf
$colSoftware = $objWMIService.ExecQuery ("Select * from Win32_Product", "WQL", _
  $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If @error Then
MsgBox(16, "Test wmi", "ExecQuery Error: Select * from Win32_Product")
Exit
EndIf
For $objSoftware In $colSoftware
If $objSoftware.Caption <> "0" Then
  MsgBox(0, "Test wmi", "Caption: " & $objSoftware.Caption & @LF & _
    "Version: " & $objSoftware.Version & @LF & _
    "IdentifyingNumber: " & $objSoftware.IdentifyingNumber)
EndIf
Next

8)

NEWHeader1.png

Link to comment
Share on other sites

I recieve the same error...

@BigDod

this should work on your pc

(Win Xp Home or Pro)

Global Const $wbemFlagReturnImmediately = 0x10
Global Const $wbemFlagForwardOnly = 0x20
$s_Machine = "BLINGBLING"

$objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $s_Machine & "\root\cimv2")
If @error Then
MsgBox(16, "Test wmi", "ObjGet Error: winmgmts")
Exit
EndIf
$colSoftware = $objWMIService.ExecQuery ("Select * from Win32_Product", "WQL", _
  $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If @error Then
MsgBox(16, "Test wmi", "ExecQuery Error: Select * from Win32_Product")
Exit
EndIf
For $objSoftware In $colSoftware
If $objSoftware.Caption <> "0" Then
  MsgBox(0, "Test wmi", "Caption: " & $objSoftware.Caption & @LF & _
    "Version: " & $objSoftware.Version & @LF & _
    "IdentifyingNumber: " & $objSoftware.IdentifyingNumber)
EndIf
Next

8)

Error received "Test wmi" "ObjGet Error: winmgmts"

(Win XP PRO SP")


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

and you used the name of your computer you are currently on..

not the local network name

?

8)

I used the name a computer on my network and got the message. When I use my computer name it works fine. Sorry for misleading you.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

after reading thru microsofts encrypted documentation, it looks like if you don't have a domain server to authenticate the user making the remote wmi request it won't work.

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

after reading thru microsofts encrypted documentation, it looks like if you don't have a domain server to authenticate the user making the remote wmi request it won't work.

Shame, but it is still an awesome tool that lots of people will find useful.

Keep up the good work. ;):P:mad2:


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

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...