Retrieve information of a remote machine in vbscript

V

Vicens Ferran

At first a beg your pardon for my poor English...And also I'm new in
vbscripting...

My Question: It's possible to retrieve information like Operating System
characteristics, Video, Processor, Disk space (free and total) for example of
a remote machine into a domain and put this information in Access tables with
Access vb script? I would like to be able to do a machine inventory by net
putting the information in access 2007 to work it.

I have tried it in WSH and in Access but I always have system messages like
"User without permissions..." or "RPC server is not in use...". I use a user
with Domain Administrator permissions.

I have catched the examples in the Script Center and in Hey, Scripting Guy!
sites...

Someone can give me ideas? Someone have examples in access?

Thank you all in advance.
--
Vicens Ferran
Net Administrator
 

My Computer

P

Pegasus \(MVP\)

"Vicens Ferran" <[email protected]> wrote in message
news:[email protected]

> At first a beg your pardon for my poor English...And also I'm new in
> vbscripting...
>
> My Question: It's possible to retrieve information like Operating System
> characteristics, Video, Processor, Disk space (free and total) for example
> of
> a remote machine into a domain and put this information in Access tables
> with
> Access vb script? I would like to be able to do a machine inventory by net
> putting the information in access 2007 to work it.
>
> I have tried it in WSH and in Access but I always have system messages
> like
> "User without permissions..." or "RPC server is not in use...". I use a
> user
> with Domain Administrator permissions.
>
> I have catched the examples in the Script Center and in Hey, Scripting
> Guy!
> sites...
>
> Someone can give me ideas? Someone have examples in access?
>
> Thank you all in advance.
> --
> Vicens Ferran
> Net Administrator
This script might help: http://dieseyer.de/scr-html/hardwareinventur.html
 

My Computer

V

Vicens Ferran

Thank you a lot...

I've seen the link and think very, very useful...Thanks...

But I've resolved my problem. I was executing scripts in a machine out of
the domain (my personal notebook). When I've done it in a domain's machine
them have executed without problems.

Thank you very much
--
Vicens Ferran
Net Administrator


"Pegasus (MVP)" wrote:
 

My Computer

R

Richard Mueller [MVP]

Vicens Ferran wrote:

> At first a beg your pardon for my poor English...And also I'm new in
> vbscripting...
>
> My Question: It's possible to retrieve information like Operating System
> characteristics, Video, Processor, Disk space (free and total) for example
> of
> a remote machine into a domain and put this information in Access tables
> with
> Access vb script? I would like to be able to do a machine inventory by net
> putting the information in access 2007 to work it.
>
> I have tried it in WSH and in Access but I always have system messages
> like
> "User without permissions..." or "RPC server is not in use...". I use a
> user
> with Domain Administrator permissions.
>
> I have catched the examples in the Script Center and in Hey, Scripting
> Guy!
> sites...
>
> Someone can give me ideas? Someone have examples in access?
>
You can use WMI in a VBScript program to retrieve this information. The
remote computers must be Windows 2000 or above (or have WMI installed) and
you should be a member of a group (like Domain Admins) that is local
administrator on the remote computers (Domain Admins is a member of the
local Administrators group by default when computers join the domain). A
brief example (based on an example from the Script Center) to retrieve
Operating System information and echo to the command console:
===========
' Specify NetBIOS name of the remote computer.
strComputer = "TestComputer"

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")

Set colOSes = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
For Each objOS in colOSes
Wscript.Echo "Computer Name: " & objOS.CSName
Wscript.Echo "Caption: " & objOS.Caption 'Name
Wscript.Echo "Version: " & objOS.Version 'Version & build
Wscript.Echo "Build Number: " & objOS.BuildNumber 'Build
Wscript.Echo "Build Type: " & objOS.BuildType
Wscript.Echo "OS Type: " & objOS.OSType
Wscript.Echo "Other Type Description: " & objOS.OtherTypeDescription
WScript.Echo "Service Pack: " & objOS.ServicePackMajorVersion & "." & _
objOS.ServicePackMinorVersion
Next
=========
If you can't get the above to work, then either you are blocked by a
firewall, DCOM is disabled, you lack connectivity, you lack permissions, or
WMI is corrupt (either on your computer or the remote computer).

I don't code Access, but I have an example VBScript program that documents
all computers in the domain to a Microsoft Excel spreadsheet linked here:

http://www.rlmueller.net/Inventory.htm

I believe the are WMI classes for all of the properties you mentioned, so
they can be retrieved using similar code. Besides the Script Center, these
links to Microsoft Windows 2000 Scripting Guide should help:

http://www.microsoft.com/technet/scriptcenter/guide/sas_cpm_overview.mspx

http://www.microsoft.com/technet/scriptcenter/guide/sas_fsd_overview.mspx

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--
 

My Computer

V

Vicens Ferran

Thank you a lot...

All of you have given me very good ideas.

Thank you for all...
--
Vicens Ferran
Net Administrator


"Richard Mueller [MVP]" wrote:

> Vicens Ferran wrote:
>

> > At first a beg your pardon for my poor English...And also I'm new in
> > vbscripting...
> >
> > My Question: It's possible to retrieve information like Operating System
> > characteristics, Video, Processor, Disk space (free and total) for example
> > of
> > a remote machine into a domain and put this information in Access tables
> > with
> > Access vb script? I would like to be able to do a machine inventory by net
> > putting the information in access 2007 to work it.
> >
> > I have tried it in WSH and in Access but I always have system messages
> > like
> > "User without permissions..." or "RPC server is not in use...". I use a
> > user
> > with Domain Administrator permissions.
> >
> > I have catched the examples in the Script Center and in Hey, Scripting
> > Guy!
> > sites...
> >
> > Someone can give me ideas? Someone have examples in access?
> >
>
> You can use WMI in a VBScript program to retrieve this information. The
> remote computers must be Windows 2000 or above (or have WMI installed) and
> you should be a member of a group (like Domain Admins) that is local
> administrator on the remote computers (Domain Admins is a member of the
> local Administrators group by default when computers join the domain). A
> brief example (based on an example from the Script Center) to retrieve
> Operating System information and echo to the command console:
> ===========
> ' Specify NetBIOS name of the remote computer.
> strComputer = "TestComputer"
>
> Set objWMIService = GetObject("winmgmts:" _
> & "{impersonationLevel=impersonate}!\\" _
> & strComputer & "\root\cimv2")
>
> Set colOSes = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
> For Each objOS in colOSes
> Wscript.Echo "Computer Name: " & objOS.CSName
> Wscript.Echo "Caption: " & objOS.Caption 'Name
> Wscript.Echo "Version: " & objOS.Version 'Version & build
> Wscript.Echo "Build Number: " & objOS.BuildNumber 'Build
> Wscript.Echo "Build Type: " & objOS.BuildType
> Wscript.Echo "OS Type: " & objOS.OSType
> Wscript.Echo "Other Type Description: " & objOS.OtherTypeDescription
> WScript.Echo "Service Pack: " & objOS.ServicePackMajorVersion & "." & _
> objOS.ServicePackMinorVersion
> Next
> =========
> If you can't get the above to work, then either you are blocked by a
> firewall, DCOM is disabled, you lack connectivity, you lack permissions, or
> WMI is corrupt (either on your computer or the remote computer).
>
> I don't code Access, but I have an example VBScript program that documents
> all computers in the domain to a Microsoft Excel spreadsheet linked here:
>
> http://www.rlmueller.net/Inventory.htm
>
> I believe the are WMI classes for all of the properties you mentioned, so
> they can be retrieved using similar code. Besides the Script Center, these
> links to Microsoft Windows 2000 Scripting Guide should help:
>
> http://www.microsoft.com/technet/scriptcenter/guide/sas_cpm_overview.mspx
>
> http://www.microsoft.com/technet/scriptcenter/guide/sas_fsd_overview.mspx
>
> --
> Richard Mueller
> MVP Directory Services
> Hilltop Lab - http://www.rlmueller.net
> --
>
>
>
 

My Computer

Top