473,399 Members | 3,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

WMI-Query of a Remote Machine

Hi Folks,

I ´ve created a Page the should query a remote Server via WMI. But if I
start the Page, I only get the information about my local PC. I´ve pasted
the code. Please look, If somebody could find an error.

<% @Import Namespace="System"%>
<% @Import Namespace="System.IO"%>
<% @Import Namespace="System.Management"%>

<script language="VB" runat="server">

Sub Page_Load(s as object, e as eventargs)

dim sServerPath as string = "\\computer\root\cimv2"
Dim conOptions As New ConnectionOptions()

conOptions.Authentication = AuthenticationLevel.Call
conOptions.Impersonation = ImpersonationLevel.Impersonate
conOptions.Username = "Domain\User"
conOptions.Password = "Password"

dim Scope as new ManagementScope(sServerPath,conOptions)

Scope.Connect()
Dim objectQuery As New ObjectQuery("select * from Win32_Bios")
Dim searcher As New ManagementObjectSearcher(objectQuery)
Dim share As ManagementObject
Dim BiosEntry As ManagementObject

For Each BiosEntry in searcher.Get()
response.write("Ser-Number: " & BiosEntry("SerialNumber"))
Next BiosEntry

End Sub
Nov 17 '05 #1
0 977

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Colin Brown | last post by:
Recently I was looking for remote management tools and came across "Windows Management Instrumentation". There is a python interface available: http://tgolden.sc.sabren.com/python/wmi.html I...
1
by: Olav | last post by:
I'm having a problem when I try to make a standalone installation of a Python program using Tim Goldens WMI-module. The py2exe produce the exe-file as expected, but it fails to execute. I have...
0
by: Ewart MacLucas | last post by:
generated some WMI managed classes using the downloadable extensions for vs2003 from mircrosoft downloads; wrote some test code to enumerate the physicall processors and it works a treat, but a...
9
by: cj | last post by:
I found this code online and it works fine but I don't understand exactly how and am trying to. Can someone help me? Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows...
7
by: gel | last post by:
Below is how it is down with vbscript. What is the best way to convert this to python? strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" &...
2
by: Chen Houwu | last post by:
------------------sample code begin------------------------- import threading import wmi def run(*args): c = wmi.WMI () memory=c.Win32_LogicalMemoryConfiguration() info='Total Virtual...
0
by: kath | last post by:
Hi, the following is code snippet I used to run plink command from Python. If I run plink command directly it pops out a command prompt window. To make the command promot window invisible I used...
5
by: kyosohma | last post by:
Hi, I am trying to create a post logon script which does various tasks, like setup a printer based on location. While most of it works very fast, I have a second Python script that I run that...
1
by: thunder54007 | last post by:
hi, here is my script: import win32con import time import wmi c = wmi.WMI() for process in c.Win32_Process(name = "notepad.exe"): print process.ProcessId, process.Name process.Terminate ()
25
by: patrol | last post by:
I want to prevent some process from running. The code is in the following. I encounter some unexpected troubles. Probelm1: This program cannot terminate "scrcons.exe" and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.