Page 2 of 2 <12
Topic Options
#166621 - 2006-08-31 04:26 PM Re: WMIQuery() Problem and Remote Registry (Update)
private_meta Offline
Getting the hang of it

Registered: 2006-07-27
Posts: 80
Loc: Austria
btw, witto, any idea about the issue 4 posts above? (just wanna be sure it's not overread XD)
Top
#166622 - 2006-08-31 04:44 PM Re: WMIQuery() Problem and Remote Registry (Update)
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
No, I am sorry. Have tried the WMIQuery() between 2 computers, just like accessing the registry. I took the last example and tested it locally. That worked. I added computername, computername\adminaccount and password. It just showed nothing. Sorry. I will be doing something wrong, but I do not know what. Maybe some real guru can help you. I just focussed on the registry thing because I thought that was an easy one.
Top
#166623 - 2006-08-31 05:08 PM Re: WMIQuery() Problem and Remote Registry (Update)
private_meta Offline
Getting the hang of it

Registered: 2006-07-27
Posts: 80
Loc: Austria
That's ok... but again, i'm wondering why the WMIQuery UDF accesses my Floppy Drive while the piece of code WITHOUT WMIQuery() does not...

I've tried it with this one as well
Code:
$colItems = $WMI.ExecQuery("Select FreeSpace from Win32_LogicalDisk WHERE DriveType = 3",,48)
For Each $objItem in $colItems
?"Free Space: " + $objItem.Freespace
?"-----------"
Next



and i even checked the SQL-Statement generated by the WMIQuery
(it generated "Select FreeSpace From Win32_LogicalDisk Where DriveType = '3'" as well) but still there are different outputs.

furthermore i tried to extract the WMIQuery-Part for external Computers like shown below, but it didn't work at all

Code:
$objLocator = CreateObject('WbemScripting.SWbemLocator')
If @ERROR or not $objLocator Exit VAL("&"+Right(DecToHex(@ERROR),4)) EndIf
$SystemSet = $objLocator.ConnectServer($sComputer, $root, $sUserID, $sUserPW)
If @ERROR or not $SystemSet Exit VAL("&"+Right(DecToHex(@ERROR),4)) EndIf
$SystemSet.Security_.ImpersonationLevel = 3
$objEnum = $SystemSet.ExecQuery($sQuery)
FOR EACH $objInstance in $objEnum
$=EXECUTE(CHR(36) + 'sValue = ' + CHR(36) + 'objInstance.' + $sWhat)
IF VARTYPE($sValue) & 8192
$tmp = $tmp +'|' + join($sValue,'|')
ELSE
$tmp = $tmp +'|' + $sValue
ENDIF
Next
? SPLIT(SUBSTR($tmp,2),'|')



Edit: Do i need more then the Variables $sQuery, $sComputer, $root, $sUserID, $sUserPW there?


Edited by private_meta (2006-08-31 05:10 PM)
_________________________
-=If you absolutly believe you can make up talent with hard work, there is no limit to what you can't achieve.=-

Top
#166624 - 2006-08-31 08:20 PM Re: WMIQuery() Problem and Remote Registry (Update)
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
Here is what I would try.

You say the local Administrator account password is the same for ALL workstations in this workgroup - YES?

1. Make sure all workstations are in the same WORKGROUP name.

2. Logon to your workstation with that same Administrator/Password.

Then try running Regedit or other Admin tools and it should operate those tools as though you were logged on to that system as they Administrator.

The account name and passworkd MUST match on both systems.

If that all works then try the WMI. If it does not work then you need to modify the "root\cimv2" connection permissions and also verify that the "root\cimv2" is still the default connection namespace and that someone has not renamed it.

Top
#166625 - 2006-08-31 10:45 PM Re: WMIQuery() Problem and Remote Registry (Update)
private_meta Offline
Getting the hang of it

Registered: 2006-07-27
Posts: 80
Loc: Austria
I'm not at work right now so i cannot confirm everything i say, but let me say the following:

The Administrator account is on EVERY win2k system the same except for 2 Machinse that belong to the sysadmin. On Win2k-Systems it works ok, i can connect, i can log in, i get the WMI-Information, but as soon as i want to access a WinXP-Workstation FROM win2k or another winxp workstation it does not work. From win2k it says that the RPC-Server could not be found, and from Winxp it just says "denied", tho it works when i access it locally and the rights should be given correctly (to the administrator account in the WMI)

I cannot say it with absolute certainty, but i'm pretty sure these 2 xp-systems and all the win2k systems i tried it with are in the same workgroup (i'm sure for the 2k-sys and one of the xp-sys)

The XP-Firewall is disabled as well for the testing, so i absolutly don't think it would be connection problems (as i can access 2k-systems from the xp-systems)

About the default namespace: how do i set it for a default namespace?

And NTDOC: any idea about the accessing of the Floppy drive? i don't know why it access it, but it doesn't do that when access the WMI without the script. would be nice.

Top
#166626 - 2006-08-31 11:19 PM Re: WMIQuery() Problem and Remote Registry (Update)
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
I've done this in the past but no longer really have systems in workgroups and different OS to script it for you.

However, please review the documentation here which should help you to undertand better what or how your scripting may be failing and how to correct it.

Connecting to WMI on a Remote Computer
http://msdn.microsoft.com/library/defaul...te_computer.asp

Connecting Between Different Operating Systems
http://msdn.microsoft.com/library/defaul...ing_systems.asp

Top
#166627 - 2006-08-31 11:44 PM Re: WMIQuery() Problem and Remote Registry (Update)
private_meta Offline
Getting the hang of it

Registered: 2006-07-27
Posts: 80
Loc: Austria
Thanks, i'll look through it tomorrow @ work, it's almost midnight here...
i just hope i don't dream about WMI and SQL again like last night... (no joke, really)
_________________________
-=If you absolutly believe you can make up talent with hard work, there is no limit to what you can't achieve.=-

Top
#166628 - 2006-09-01 12:57 PM Re: WMIQuery() Problem and Remote Registry (Update)
private_meta Offline
Getting the hang of it

Registered: 2006-07-27
Posts: 80
Loc: Austria
I tried everything that has been shown to me in those two links you gave me, NTDOC, but nothing helped. I just can't access Windows XP-Computers from the Win2k-Workstation. I tried everything, set up all the WMI stuff but it just does not work... the error is
"COM exception error "ConnectServer" (SWbemLocator - Der RPC-Server ist nicht verfügbar.)"
(means "RPC-Server is not available")
i don't have any more ideas...

Top
#166629 - 2006-09-01 09:27 PM Re: WMIQuery() Problem and Remote Registry (Update)
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
Not sure what to tell you guy. I've done it in the past so unless XP SP2 has broken it, it does work.

Unlikely maybe, but could also maybe be that your OS is not native English as MS often does not fully port everything to other languages (but that is a long shot which I doubt is the real issue).

And you're 100% certain that you've checked/modified the launch / execute rights for the systems involved?

Have you tried running from another 2000 workstation to the XP boxes?

Why not just run it from an XP box if XP can talk to 2000 and XP - then just don't run it from a 2000 box.

Top
#166630 - 2006-09-06 05:34 PM Re: WMIQuery() Problem and Remote Registry (Update)
private_meta Offline
Getting the hang of it

Registered: 2006-07-27
Posts: 80
Loc: Austria
Sorry, i've been busy this week until now.

My OS is native german, but i hopefully doubt that MS ported such a quite important feature...

I'm 100% certain that i've set the rights in the right way

I have tried connecting to XP-boxes from other XP-boxes, i've tried it from other 2000-boxes, neither of them does work. In addition, i still have the problem that i can not run the WMIQuery-Script as a different user. TBH i can not run it even with any user. As soon as i enter User Information when calling WMIQuery it does not work, no matter what computer i try to access (Administrator account, user accounts, no matter what, it does not work, even when i try to access those that work without a user because the user on both workstations is the same)

Top
#166631 - 2006-09-09 05:52 AM Re: WMIQuery() Problem and Remote Registry (Update)
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Maybe How to troubleshoot WMI-related issues in Windows XP SP2 and How to Set Security in Windows XP Professional That Is Installed in a Workgroup help?
_________________________
There are two types of vessels, submarines and targets.

Top
Page 2 of 2 <12


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 675 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.104 seconds in which 0.067 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org