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

  • From: "Chris Lynch" <lynch00@xxxxxxx>
  • To: <thin@xxxxxxxxxxxxx>
  • Date: Mon, 18 Nov 2002 10:44:19 -0800

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

Ok.  So I took your suggestion, and I have updated the code to this:

- =
-------------------------------------------------------------------------=
--
Option explicit =20
  Dim oContainer, oComputer1, oNetwork
  Dim sDomainName, sComputer
  Set oNetwork =3D WScript.CreateObject("WScript.Network")
 =20
  Set oContainer =3D GetObject("WinNT://AXCENT")
  oContainer.Filter =3D Array("user" & "$")
  For Each oComputer1 in oContainer  =09
        If oContainer.UserFlags And UF_SERVER_TRUST_ACCOUNT Then=20
            Wscript.Echo oComputer1.Name & " is a Server."
        Elseif oContainer.UserFlags And UF_DONT_EXPIRE_PASSWD Then
                Wscript.Echo oComputer1.Name & " is a Domain Controller."
        Elseif oContainer.UserFlags And UF_WORKSTATION_TRUST_ACCOUNT Then
                Wscript.Echo oComputer1.Name & " is a Workstation."
        End If
  Next

MsgBox "DONE."
- =
-------------------------------------------------------------------------=
--

I get the following error message:

C:\Working>cscript getserverlist2.vbs >servelist2.txt
C:\Working\getserverlist2.vbs(9, 4) Microsoft VBScript runtime error: =
Object doe
sn't support this property or method: 'UserFlags'

Anyone know what I'm doing wrong?

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 Braebaum, Neil
Sent: Monday, November 18, 2002 8:56 AM
To: 'thin@xxxxxxxxxxxxx'
Subject: [THIN] Re: OT: VBScript/WSH/WMI question.



You can't - notice I said "role" (the property is explicitly "role") - =
this should equate to workstation or server - as you'd see in server =
manager.

Other than that, to differentiate the PDC, use the userflags properties =
(as suggested by somebody else) on the machine account.

Neil

> -----Original Message-----
> From: Chris Lynch [mailto:lynch00@xxxxxxx]
> Sent: 18 November 2002 16:44
> To: thin@xxxxxxxxxxxxx
> Subject: [THIN] Re: OT: VBScript/WSH/WMI question.
>=20
> Ok?!?  Then, how would I get the "domainrole" via the WINNT
> provider, =3D and not the WINMGMT provider (WMI)?  I have asked=20
> around, and haven't =3D gotten any response to my question.
> - -----Original Message-----
> From: thin-bounce@xxxxxxxxxxxxx=20
> [mailto:thin-bounce@xxxxxxxxxxxxx] On =3D Behalf Of Braebaum, Neil
> Sent: Monday, November 18, 2002 1:46 AM
> To: 'thin@xxxxxxxxxxxxx'
> Subject: [THIN] Re: OT: VBScript/WSH/WMI question.
>=20
> I would have thought role is available as a property, through
> the WinNT =3D provider, from an NT4 domain - after all - server=20
> manager differentiates =3D between servers, workstations and DCs.
>=20
> I think operating system is available, too - you may be
> correct about =3D processors and HAL - I've never tried to=20
> access them from an NT4 domain.

***********************************************************************
This e-mail and its attachments are intended for the above named=20
recipient(s) only and are confidential and may be privileged. If they =
have come to you in error you must take no action based=20
on them, nor must you copy or disclose them or any part of=20
their contents to any person or organisation; please notify the=20
sender immediately and delete this e-mail and its attachments from=20
your computer system.

Please note that Internet communications are not necessarily secure=20
and may be changed, intercepted or corrupted. We advise that=20
you understand and observe this lack of security when e-mailing us=20
and we will not accept any liability for any such changes,=20
interceptions or corruptions.=20

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=20
with good computing practice the recipient should ensure they=20
are actually virus free.

Copyright in this e-mail and attachments created by us belongs=20
to Littlewoods.=20

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.=20
Statements and opinions contained in this e-mail may not=20
necessarily represent those of Littlewoods.

Please note that e-mail communication may be monitored.

Registered office:=20
Littlewoods Retail Limited,=20
Sir John Moores Building,=20
100 Old Hall Street,=20
Liverpool,
L70 1AB=20
Registered no: 421258=20

http://www.littlewoods.com=20
***********************************************************************

***********************************************=20
This Weeks Sponsor: Wyse Technologies
Get a free whitepaper on how to secure
your corporate data from Wyse. Click Below.=20
http://thethin.net/wyse.cfm=20
***********************************************=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/AwUBPdk1A+dk9GeQ3R5SEQIaywCg0u/RzVl+tI58uVenflS6/br9OVkAnA7g
oJz9iudoVsgTjORwfv2a2Jqw
=3DcwMP
-----END PGP SIGNATURE-----


*********************************************** 
This Weeks Sponsor: Wyse Technologies
Get a free whitepaper on how to secure
your corporate data from Wyse. Click Below. 
http://thethin.net/wyse.cfm 
*********************************************** 
For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link.

http://thethin.net/citrixlist.cfm

Other related posts: