[THIN] Re: OT: VBScript/WSH/WMI question.

  • From: "Chris Lynch" <lynch00@xxxxxxx>
  • To: <thin@xxxxxxxxxxxxx>
  • Date: Fri, 15 Nov 2002 12:51:11 -0800

=20
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Well, Mark is correct.  But, we don't want to manually add any servers =
into our script.  We just want to search the domain for any and all =
servers, get some WMI information, and that is it.  The "DomainRole" is =
also a WMI property, but in order to get that, you need to have the =
servers/computers name.  And, we want to "search" the domain for those =
objects.

We could probably use the USER filter (with the $ at the end) to get the =
computers name, pass that to a variable, and then use that to open the =
local WMI provider on the server.  That would most likely be the way we =
could do it.  I have my colleague (who is a much better scripter than I) =
look at Larry's suggestion.

If anyone else has any other input, I would be very grateful.

Thanks,

Chris Lynch, MCSE CCNA CCA
Network Engineer
Axcent Solutions
clynch@xxxxxxxxxxxxxxxxxxx
(949) 338-1904=20

- -----Original Message-----
From: thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx] On =
Behalf Of Mark Schill
Sent: Friday, November 15, 2002 12:44 PM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Re: OT: VBScript/WSH/WMI question.



Thanks for the update. I have always just hardcoded the PDC name in all =
of my scripts cause there was never that many of them that I had to work =
with.

Mark

> Two problems with that, Mark.
>
> My ADSI reference says that the role property of iadscomputer isn't=20
> supported through the WinNT provider, and as Chris doesn't have AD,=20
> yet - that's all he's got.
>
> And it (apparently - never tried to use it, personally) only=20
> differentiates between servers and workstations (according to my=20
> reference).
>
> Looks like the WMI code might identify - but it will require local WMI =

> support.
>
> Neil
>
>> -----Original Message-----
>> From: Mark Schill [mailto:Mark.Schill@xxxxxxxxxxxx]
>> Sent: 15 November 2002 20:31
>> To: thin@xxxxxxxxxxxxx
>> Subject: [THIN] Re: OT: VBScript/WSH/WMI question.
>>
>> Chris,
>>
>> This might be of some help. When you enumerate the computers in the=20
>> domain see what the 'Role' property provides. I.E. oComputer1.Role I=20
>> am not sure if it determines the PDC or just if it is a domain=20
>> controller. Let me know if that helps.
>>
>> > I have created a script (along with another engineer) to
>> gather useful
>> > =3D information in a specific domain.  It will scan for all
>> "computer" =3D
>> > objects, and query some WMI stuff from them.  BUT, I cannot
>> get the =3D
>> > script to "find" the PDC.  It "finds" and queries the BDC in the =20
>> > domain
>> just fine.  If I specify the PDC servers name in the
>>  =3D script,
>> > the script will connect to WMI and query the information we
>> =3D need. I
>> > don't want to have to enter in the server name for every
>> time =3D we run
>> > this script.
>> >
>> > Below, you will find a sample of how we "find"
>> computer/server objects
>> > =3D using the WINNT provider.  We are not running AD, but are
>> planning
>> > the =3D migration.  We already have another script for the ADSI =20
>> > provider.
>> >
>> > - ---------------------------------------------------------------=20
>> > Option
>> explicit
>> >   Dim oContainer, oComputer1, oNetwork
>> >   Dim sDomainName, sComputer
>> >   Set oNetwork =3D3D WScript.CreateObject("WScript.Network")
>> >   sDomainName =3D3D oNetwork.UserDomain
>> >
>> >   Set oContainer =3D3D GetObject("WinNT://" & sDomainName)
>> >   oContainer.Filter =3D3D Array("computer")
>> >   For Each oComputer1 in oContainer
>> >     sComputer =3D3D oComputer1.Name
>> >     Wscript.Echo oComputer1.Name
>> >   Next
>> >
>> > MsgBox "DONE."
>> > - ---------------------------------------------------------------
>
> **********************************************************************
> * This e-mail and its attachments are intended for the above named
> recipient(s) only and are confidential and may be privileged. If they=20
> have come to you in error you must take no action based on them, nor=20
> must you copy or disclose them or any part of their contents to any=20
> person or organisation; please notify the sender immediately and=20
> delete this e-mail and its attachments from  your computer system.
>
> Please note that Internet communications are not necessarily secure =20
> and may be changed, intercepted or corrupted. We advise that you=20
> understand and observe this lack of security when e-mailing us  and we =

> will not accept any liability for any such changes, interceptions or=20
> corruptions.
>
> Although we have taken steps to ensure that this e-mail and its=20
> attachments are free from any virus, we advise that in keeping with=20
> good computing practice the recipient should ensure they are actually=20
> virus free.
>
> Copyright in this e-mail and attachments created by us belongs to=20
> Littlewoods.
>
> Littlewoods takes steps to prohibit the transmission of offensive, =20
> obscene or discriminatory material.  If this message contains=20
> inappropriate material please forward the e-mail intact to=20
> postmaster@xxxxxxxxxxxxxxxxx and it will be investigated. Statements=20
> and opinions contained in this e-mail may not necessarily represent=20
> those of Littlewoods.
>
> Please note that e-mail communication may be monitored.
>
> Registered office:
> Littlewoods Retail Limited,
> Sir John Moores Building,
> 100 Old Hall Street,
> Liverpool,
> L70 1AB
> Registered no: 421258
>
> http://www.littlewoods.com
> **********************************************************************
> *
>
> ***********************************************
> For Archives, to Unsubscribe, Subscribe or
> set Digest or Vacation mode use the below link.
>
> http://thethin.net/citrixlist.cfm




***********************************************=20
For Archives, to Unsubscribe, Subscribe or=20
set Digest or Vacation mode use the below link.

http://thethin.net/citrixlist.cfm

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0 (Build 349) Beta
Comment: Public PGP key for Chris Lynch

iQA/AwUBPdVeP+dk9GeQ3R5SEQI4xQCfU7E06XSAm05Z0lpEfQfa/tTM+OMAn0js
1njz4HY9C3oIS/4m4XDzN+mU
=3D3kDf
-----END PGP SIGNATURE-----



*********************************************** 
For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link.

http://thethin.net/citrixlist.cfm

Other related posts: