|
|
 |

 |
|
Microsoft® Windows® 2000 Scripting Guide
|
|
|
Author
|
|
The Microsoft Windows Resource Kit Scripting Team
|
|
|
Pages
|
1328
|
|
Disk
|
1 Companion CD(s)
|
|
Level
|
Int/Adv
|
|
Published
|
12/16/2002
|
|
ISBN
|
9780735618671
|
|
Price
|
$49.99
To see this book's discounted price, select a reseller below.
|
|
|
|
|
 |
|
|
Index
Special Characters
#.# (pound signs), VBScript date literals 61
% (percentage symbols), environment variables 201
& (ampersand), concatenating strings 29
( ) (parentheses)
enclosing If-Then statements 1165
in mathematical expressions 1174
operator precedence, VBScript 83
* (multiplication operator), VBScript operator precedence 82-83
. (dot notation)
Automation objects, calling methods 21
Automation objects, retrieving properties 22
binding to current folder 250
.. (dot-dot notation), binding to root folder 250
/ (division operator), VBScript operator precedence 82-83
/ (forward slash), in named arguments 164, 170
: (colon), in named arguments 164, 170
\ (backslash), binding to root folder 250
_ (underscore), VBScript line continuation character 48-49
+ (addition operator), VBScript operator precedence 82-83
= (equals sign), initializing VBScript variables 52
> character, redirecting script output to text files 145
>> characters, redirecting script output to text files 145
8.3 naming convention 1149
88 classes, Active Directory 399
.csv files
converting to arrays, VBScript 101-102
log files, parsing 877
saving script output for use with tabular data control 1092, 1096
.dll files, WMI providers 438-439
.exe files See executable files
.gif files, showing script progress with 1131
.hta files See HTAs
.htm files, converting to .hta files 1090
.js files, WSH-compliant scripting languages 137
.lnk files 191
.mof files
method definitions in 469
overview 467
property definitions in 469
retrieving class definition in 477-478
.pls files, WSH-compliant scripting languages 136
.txt files See text files
.vbs files, WSH-compliant scripting languages 137
A
abstract classes, Active Directory 399
abstract classes, WMI 450, 465
Abstract qualifier, WMI 465, 470
AcceptPause property, Win32_Service class 978-980, 989
AcceptStop property, Win32_Service class 978-980, 989
Access denied (error) 284
Access Denied error message 662-663
access rights
See also permissions
to registry subkeys, administering 1047-1048
Accesses property, Win32_SoftwareFeature class 658-659
accessing databases with enterprise scripts 1103
accountDisabled attribute, Computer class 691
accounts
computer See computer accounts
LocalSystem account 1006-1007
service account passwords 1009-1010
service accounts 1006-1008
user See user accounts
AccountStatus property, DiskQuotaControl object 748-749
Active Directory
See also directory service objects
Active Directory store 393
Active Directory-specific computer roles 716
architecture See Active Directory architecture
as a database 1104
as managed resource 436
attributes See attributes, Active Directory
binding to 1070
classes See Active Directory classes
computer accounts See computer accounts
Computer class 691-693
Configuration partition 406
containers See Active Directory containers
domain controllers, enumerating 716-717
Domain Directory partition 406
global catalog servers, enabling and disabling 723-724
global catalog servers, identifying 722
locating resources See searching in Active Directory
objects See directory service objects
operations master roles, identifying 719-721
partitions 406
printer location tracking 919-922
published folders, administrative tasks 836
published folders, deleting 839-840
published folders, enumerating 836-837
published folders, searching for 838
publishing shared folders 834-835
replication See Active Directory replication
Schema partition 406
schema See Active Directory schema
searching See searching in Active Directory
snap-ins See snap-ins
user accounts See user accounts
Active Directory architecture
See also Active Directory
attributes 395
classes 395
Database Layer 393
Directory System Agent 393
Extensible Storage Engine 393
forests 394
LDAP 393
logical structure 394-413
physical architecture 393
schemas 395
trees 394
Active Directory classes
See also Active Directory
attributes replicated to Global Catalog 407, 410
categorization 398-403
class list, Active Directory Schema Snap-in 403
in Active Directory architecture 395
indexed attributes 409, 410
inheritance 398-403
instantiation 395
mandatory attributes 396-398
objectClassCategory attribute 399
operational attributes 412
optional attributes 396-398
parent classes 403
subClassOf attribute 403
systemAuxiliaryClass attribute 401
systemMayContain attribute 396
systemMustContain attribute 396
Active Directory containers
configuration container, binding to 392
enterprise scripts and 1070-1072
enumerating contents 386
enumerating contents to perform tasks on 387
enumerating objects of specific types 388
enumeration, managing user accounts 613-614
retrieving computer names from 1070-1072
schema container, binding to 392
searching for attributes 593, 596, 598
selecting for user account creation 556
Active Directory objects See directory service objects
Active Directory provider, WMI 438-439
Active Directory replication
attributes replicated to Global Catalog 407, 410
full replicas 406
overview 406
partial replicas 406
Active Directory schema
Active Directory Schema Snap-in 403
ADSI Edit snap-in 405
in Active Directory architecture 395
Active Directory Schema Snap-in 403
Active Directory searches See searching in Active Directory
Active Directory store 393
ActiveScriptEventConsumer class 545
ActiveState ActivePerl
See also Perl
WMI and 430
ActiveX controls
HTAs and 1088
tabular data control See tabular data control
ActiveX Data Object interfaces, searching in Active Directory 589
ActiveX Data Objects See ADO
Add method, Dictionary object 298-299
addition operator (+), VBScript operator precedence 82-83
additional information about scripting 8
AddNew method
DataList object 1101
Recordset object, ADO 1107
add-on providers, WMI 438
AddPrinterConnection method, WshNetwork object 224
AddWindowsPrinterConnection method, WshNetwork object 224, 928, 929
Administrative Tools folder
See also special folders
locating special folders 788
administrator credentials required to run WMI scripts 443
administrator passwords, masking 1117-1120
Administrators group
disk quotas 748
WMI security and 444
ADO
adding records 1107-1109
ADO object model 1103
connecting to databases 1105-1107
deleting all records 1116-1117
deleting selected records 1114-1116
finding records 1109-1112
in Active Directory searches 358
overview 1103-1104
updating records 1112-1114
ADO interfaces, searching in Active Directory 589
ADO objects, in Active Directory searches 358
ADS_UF_ACCOUNTDISABLE flag 568-569
ADS_UF_PASSWD_NOTREQD flag 696
ADS_UF_WORKSTATION_TRUST_ACCOUNT flag 696
ADS_USER_FLAG_ENUM enumeration 562
ADSI
See also Active Directory
Active Directory, searching See searching in Active Directory
administrative credentials required 14
ADsPaths See ADsPaths
binding to Automation objects using VBScript 20
binding to configuration container 392
binding to current domain 391
binding to directory service objects 320-325, 333
binding to root domain 392
binding to schema container 392
choosing a scripting language 12-13
committing changes to Active Directory 331
compared to WSH 148, 226
computer accounts, copying 350
containers, enumerating contents 386
containers, enumerating contents to perform tasks on 387
containers, enumerating objects of specific types 388
copying directory service objects 350-353
Create method 310-313, 326, 327-328
creating directory service objects 310-313, 327-328
Delete method 317-318, 326, 330
deleting directory service objects 317-318, 330
directory service management overview 309
Get method 315-317, 326, 330, 346-347
GetEx method 344-345, 347
GetInfo method 346, 347-348
GetInfoEx method 346, 348-349
groups, creating 311
groups, deleting 318
groups, modifying attributes 314
groups, moving between containers 356
groups, reading attributes 316
history of 7
installed components 415
interfaces See ADSI interfaces
LDAP provider vs. WinNT provider 693
local property cache 326, 346-349
modifying directory service objects 313-315, 329, 334
MoveHere method 354-358
moving directory service objects between domains 354-355, 357
moving directory service objects 354-358
multiple scripting tasks 332-334
object model 414-415
object references, creating 325
OUs, creating 310
OUs, deleting 318
OUs, modifying attributes 313
OUs, moving between domains 357
OUs, reading attributes 315
overview 308-309
paths to directory service objects 322-325
production scripts 332-334
providers See ADSI providers
Put method 313-315, 326, 329
PutEx method 337-339
reading attributes of directory service objects 315-317, 330, 334, 346-349
renaming directory service objects 356
results of searches, performing operations on 382-385
rootDSE 390-392
searching in Active Directory See searching in Active Directory
serverless binding 390
SetInfo method 331
steps in ADSI scripts 320-331, 332-334
user accounts, copying 352
user accounts, creating 311
user accounts, deleting 318
user accounts, modifying attributes 314
user accounts, reading attributes 315
ADSI architecture
ADSI object model 414-415
ADSI-enabled applications 420
directory namespace 417
installed components 415
interfaces 414, 421-425
layers 416-420
local property cache 420
providers 417-420
router 420
ADSI Edit snap-in 405
ADSI interfaces
categorization of interfaces 422
implementation by providers 421
overview 414, 421
ADSI object model 414-415
ADSI OLE DB provider 418
ADSI providers
implementation of interfaces 421
in ADsPaths 323
interfaces supported by 423-425
list of providers 418
overview 417
ADSI router 420
ADSI scripts
printers and print management 882-883
published folders, enumerating 836-837
publishing shared folders in Active Directory 835
ADSI-enabled applications 420
ADsPath property, IADs interface 423
ADsPaths
ADSI providers 323, 419
distinguished names 323-325
overview 322
rootDSE 390-392
ADSystemInfo object 693
alerts
disk quota alerts, issuing 750
file creation events, monitoring 821-822
file deletion events, monitoring 822-823
file modification, monitoring 824
in e-mail See e-mail messages, sending from scripts
Alias (file attribute) 275
all records, deleting from databases 1116-1117
all scheduled tasks, deleting 1144
All Users Application Data folder
See also special folders
locating special folders 788
All Users Desktop folder
See also special folders
locating special folders 788
special folder identifiers 195
All Users Favorites folder
See also special folders
locating special folders 788
All Users Programs folder
See also special folders
locating special folders 788
special folder identifiers 195
All Users Start Menu
See also special folders
locating special folders 788
special folder identifiers 195
All Users Startup folder
See also special folders
locating special folders 788
special folder identifiers 195
All Users Templates folder
See also special folders
locating special folders 788
AllocatedBaseSize property, Win32_PageFileUsage class 764-765
AllowMaximum property, Win32_Share class 826
AllUsers parameter, Install method 661
AllUsersDesktop (special folder identifier) 195
AllUsersPrograms (special folder identifier) 195
AllUsersStartMenu (special folder identifier) 195
AllUsersStartup (special folder identifier) 195
ALT key, SendKeys representation 206
ampersand (&), concatenating strings 29
AND keyword
in WMI queries 512
WMI event notifications and 540
AND operator, VBScript conditional statements 92
animated .gif files, showing script progress with 1131
Anonymous impersonation, WMI 496
antecedent services
enumerating 997-998
overview 993
APIs
task-scheduling APIs 1136-1137
WMI providers and 437-438
AppActivate method, WshShell object 209
appending to text files
See also text files
ForAppending mode 283, 292, 295
overview 295
redirecting script output 145
Application Center
managing with WMI scripts 430
WMI consumer 443
WMI provider 438
Application Data folder
See also special folders
locating special folders 788
Application event log
writing events to 870-872
writing to, WSH 201-202
Application property, Internet Explorer object 1077-1079
ApplicationName property, HTA object 1088-1090
applications
See also processes
ADSI-enabled applications 420
automating See COM
auto-start programs 673-674
COM components See COM
ensuring applications are active 209
running from within scripts 184-187
sending keystrokes to See keystrokes, sending to applications
setting focus 210
without COM object model, automating 206-210
Architecture property, Win32_Processor class 620-621
architecture, Active Directory
See also Active Directory
attributes 395
classes 395
Database Layer 393
Directory System Agent 393
Extensible Storage Engine 393
forests 394
LDAP 393
logical structure 394-413
physical architecture 393
schemas 395
trees 394
architecture, WMI
See also WMI
managed resources 436
overview 434-436
security 443-444
security, DCOM 445-446
security, namespace-level 444-445
security, operating system 446
WMI consumers 443
WMI infrastructure 437-442
architecture, WSH 135-139
Archive attribute
file attribute 275
folder attribute 258
Archive property, Win32_Directory class 775-776
archiving event logs
event log backup files 852-855
overview 852
unique file names for backup files 856
arguments
See also parameters
command-line See command-line arguments
for enterprise scripts See enterprise scripts
user input 41-42
Arguments property
WScript object 167
WshShortcut object 192
arithmetic operators, VBScript operator precedence 82-83
arr (variable name prefix) 1153-1154
Array (data subtype) 1153-1154
Array function, VBScript 98
Array of Strings data type (WSH), corresponding registry and VBScript data types 204
arrays
See also collections; Dictionary object
alternatives to arrays 103
Array function 98
assigning data to, VBScript 99
creating, VBScript 98
declaring, VBScript 98
delimited strings, converting to arrays, VBScript 101-102
Dim statement 98
dynamic arrays, VBScript 100
index numbers 40
overview 39-41
parsing data files, VBScript 102
ReDim Preserve statement, VBScript 100
arrow mouse pointer in Internet Explorer 1130
ASPScriptDefaultNamespace property, Win32_WMISetting class 647-649, 651-652
ASPScriptDefaultNamespace property, Win32_WMISetting object 454
asset management
enumerating installed hot fixes 645
identifying chassis type 634-636
identifying installed service packs 643-644
installing software 660-663
inventorying computer hardware 629-636
inventorying software 654-659
logging off users 682
monitoring power status changes 686-688
operating system name and version number 637-638
operating system properties 639-641
overview 617-618
recovery options 675-682
restarting computers 685-686
retrieving BIOS information 623-626
retrieving SMBIOS information 628-629
retrieving system information 619-621
shutting down computers 682-685
startup commands 673-674
startup options 667-673
System Information snap-in 619-620
uninstalling software 666
upgrading software 664-665
WMI settings 646-652
asset tag numbers, retrieving 628-629
assetNumber attribute, printQueue object 933-935
assigning data to arrays, VBScript 99
assigning values to variables, VBScript 52
association classes, WMI 450, 466
Association qualifier, WMI 466, 470
AssociatorsOf method, SWbemServices object 487, 490
asynchronous methods, SWbemServices object 488
asynchronous mode, SWbemServices object 489
Asynchronous property, Command object (ADO) 380
asynchronous queries, enumerating files 810
asynchronous scripts, event log queries 865-866
AT APIs 1136-1137
At.exe 1136
AtEndOfLine property, StdIn stream 160
AtEndOfStream property, StdIn stream 160
attribute list, Active Directory Schema Snap-in 403
attributes
See also attribute-value pairs; names of specific classes and objects; properties
Active Directory See attributes, Active Directory
bitmap values 259-260
computer account attributes 701-703
configuring 261-262
directory service objects See attributes, directory service objects
file attributes 275-277
folder attributes 258-262
indexed attributes 409, 410
mandatory attributes 313, 329, 396, 398
multivalued See multivalued attributes, directory service objects; multivalued attributes, user accounts
null-value attributes 701-702
operational attributes 347, 412
password attributes See attributes, passwords
user account attributes See attributes, user accounts
Attributes property
Folder object 256-257
Win32_SoftwareFeature class 658-659
attributes, Active Directory
attribute list, Active Directory Schema Snap-in 403
attributes replicated to Global Catalog 407, 410
in Active Directory architecture 395
indexed attributes 409, 410
isMemberOfPartialAttributeSet attribute 407
mandatory attributes 396-398
operational attributes 412
optional attributes 396-398
searchFlags attribute 409
attributes, directory service objects
attribute names 329
IDAPDisplayNames 329
mandatory attributes 313, 329
modifying in multiple objects 382
modifying 313-315, 329, 334
multivalued attributes 336
multivalued attributes, appending 340
multivalued attributes, clearing 339, 342
multivalued attributes, deleting entries 341
multivalued attributes, modifying 336-343
multivalued attributes, PutEx method 337-339
multivalued attributes, reading 344-345
multivalued attributes, updating 339, 342
operational attributes 347
reading 315-317, 330, 334, 346-349
searching in Active Directory, referral chasing 367-369
searching in Active Directory, specifying attributes 362
attributes, passwords
See also passwords
list of attributes 561-562
userAccountControl attribute, changing flag values 565
userAccountControl attribute, displaying values 562
userAccountControl attribute, flag values 563
attributes, user accounts
See also searching in Active Directory
attributes to be returned by searches, specifying 592
attributes without values, searching for 603
available on General properties page 571-573
characteristics of attributes 570
clearing 580
copying user accounts 581-583
data type considerations 570
empty attribute values, searching for 601-605
IDAPDisplayNames, determining 570
identification attributes 553
managing, IADs interface vs. IADsUser interface 570
multivalued attributes, adding entries to 578
multivalued attributes, clearing 580
multivalued attributes, modifying 577-580
multivalued attributes, reading 573-575
multivalued attributes, removing entries from 579
multivalued attributes, searching for 608
multivalued attributes, writing 576-577
multivalued vs. single-valued attributes 570
optional attributes, default settings 555
reading 573-575
sAMAccountName attribute, verifying uniqueness 600
searching for in containers 593, 596
searching for in subcontainers 598
security principal naming attributes 554
single-valued attributes, clearing 580
single-valued attributes, reading 573-575
single-valued attributes, writing 576-577
verifying uniqueness in forests 600
writing 576-577
attribute-value pairs
See also attributes, directory service objects
attribute types, distinguished names 324
attributes, modifying 313-315, 329, 334
directory service objects, modifying 329
distinguished names 323-325
mandatory attributes 313, 329
authentication
authenticationLevel setting, WMI 497
authority setting, WMI 498
identifying current domain controller 718-719
authority setting, WMI moniker 498
Auto (service start option) 1003
automated e-mail messages See e-mail messages, sending from scripts
AutomaticResetBootOption property, Win32_ComputerSystem class 669
AutomaticResetCapability property, Win32_ComputerSystem class 669
Automation object model of Internet Explorer 1077
Automation objects
See also COM objects
applications without COM object model, automating 206-210
binding to, VBScript 19-20
calling object methods 21-22
collections See collections
default properties 1175
dot notation 21
monikers 20, 124
object references See object references
overview 122
retrieving object properties 22
VBScript and 18-19
WMI scripting library 480-483
WSH support for 131
AutoReboot property, Win32_OSRecoveryConfiguration class 676-677
AutoRecoverMOFs property, Win32_WMISetting class 647-649
auto-start programs
enumerating 673-674
Win32_StartupCommand class 674
auto-start services
configuring start options 1003-1004
error control codes 1004-1005
running 973
auxiliary classes, Active Directory 399, 401
availability
increasing service availability 974
monitoring process availability 941, 942
monitoring service availability 973, 974-975
availability of classes, WMI 471, 479
availability of printers, scheduling 918
Availability property, Win32_Printer class 885-887
available disk space
See also disk quotas
disk quotas and 748
enumerating by user 739-740
enumerating 738
monitoring in real time 740-741
AvailableSpace property, FileSystemObject 245-247
AvailableVirtualMemory property, Win32_OperatingSystem class 620-621
B
background processing See asynchronous queries, enumerating files
backing up files
event logs 844, 852-856
registry data, backing up before editing 1025-1026
backslash (\), binding to root folder 250
BACKSPACE key, SendKeys representation 206
BackupInterval property, Win32_WMISetting class 647-649, 651-652
BackupLastTime property, Win32_WMISetting class 647-649
Bad file mode (error) 285
BannerPage property, IADsPrintQueue interface 910
base option, Active Directory search scope 370, 592
batch files, moving beyond shell scripting 11
batch mode, running WSH scripts 143
batch scripts, compared to WSH scripts 133, 184
binary mode, Dictionary object 297-298
Binary Value data type (WSH), corresponding registry and VBScript data types 204
binary-tree index file, CIM repository 442
binary-valued registry entries
overview 1031-1032
reading 1032
REG_BINARY data type 1020, 1023
binding
early binding 124
late binding 124
serverless binding 390
to Active Directory 1070
to COM objects 19-20, 124
to configuration container 392
to current domain 391
to directory service objects 320-325, 333
to disk drives 245
to files 266-267
to folders 249-250
to resources, WMI 502
to root domain 392
to schema container 392
BIOS
overview 623
retrieving BIOS information 623-626
SMBIOS specification 623, 628-629
BIOSCharacteristics property, Win32_BIOS class 624-626
bit fields 562-563
bitmap values
configuring attributes 261-262
file attributes 275-277
folder attributes 260
overview 259-260
blank lines
See also white space in scripts
including in script output 157
bln (variable name prefix) 1153-1154
BlockSize property, Win32_DiskPartition class 730-732
blue screen See stop messages
Boolean (data subtype) 1153-1154
boolean expressions
readability of code 1173
testing for True and False 1173
Boolean values
in WHERE clauses, WMI queries 509
sorting with tabular data control 1096
Boot loader section, Boot.ini file 671
Boot.ini file 671
Bootable property, Win32_DiskPartition class 730-732
BootDevice property, Win32_OperatingSystem class 639-641
booting computers, startup options See startup options
BootPartition property, Win32_DiskPartition class 730-732
BootupState property, Win32_ComputerSystem class 669
Border property, HTA object 1088-1090
BorderStyle property, HTA object 1088-1090
BREAK key, SendKeys representation 206
Browse for Folder dialog box 791-792
BrowseForFolder method, Shell object 792
browsers, Internet Explorer See Internet Explorer
btree index file, CIM repository 442
build numbers, WSH, retrieving 179
Build property, WScript object 179
BuildNumber property
Win32_BIOS class 624-626
Win32_OperatingSystem class 639-641
BuildType property, Win32_OperatingSystem class 639-641
BuildVersion property, Win32_WMISetting class 647-649
built-in providers, WMI 438-439
Busy property, Internet Explorer object 1077-1079
ByRef keyword, VBScript 119
byt (variable name prefix) 1153-1154
Byte (data subtype) 1153-1154
Byte values, VBScript, CByte type conversion function 58
BytesPerSector property, Win32_DiskDrive class 726-728
ByVal keyword, VBScript 119
C
Cache Results property, Command object (ADO) 380
cache, local properties See local property cache, ADSI
Camel casing, variable names 1152
Cannot Change Password setting 561
canonicalName attribute, Computer class 691
Capabilities property
Win32_DiskDrive class 726-728
Win32_Printer class 907-908
CapabilityDescriptions property, Win32_Printer class 907-908
CAPS LOCK key, SendKeys representation 206
Caption property
HTA object 1088-1090
Win32_OperatingSystem class 638, 639-641
Win32_PrintJob class 900-902
Win32_Product class 656
Win32_ScheduledJob class 1137-1140
Win32_Share class 826
Win32_SoftwareFeature class 658-659
carriage return, VBScript statement breaks 47
carriage return/linefeed, appending to script output 157
case
See also case sensitivity
Camel casing 1152
case styles, and code readability 1171
modifying in VBScript script output 81-82
Pascal casing 1157, 1171
case sensitivity
See also case
CompareMode property, Dictionary object 297-298
variable names 1154-1155
Case statement, VBScript 96
casting type values 57
categorization
Active Directory classes 398-403
ADSI interfaces 422
Category property, Win32_NTLogEvent class 858-859
CBool function, VBScript 58
CByte function, VBScript 58
CCur function, VBScript 58
CDate function, VBScript 58
CDbl function, VBScript 58
CDO, e-mail messaging and 1121
Cdosys.dll 1121
CD-ROM (System Information category), equivalent WMI class 630
Change method, Win32_Service class 1001-1003, 1007
ChangePassword method, IADsUser interface 558, 560
changing values of registry entries
DWORD-valued entries 1033-1034
string-valued entries 1033-1034
Character property, WshRemoteError object 232
characters
allowed in variable names 1154-1155
case See case
modifying character case, VBScript 81-82
proportional vs. non-proportional fonts 78-79
reading text files character-by-character 290-292
SendKeys representations of keyboard characters 206-207
Chase Referrals property, Command object (ADO) 367
chassis type, identifying 634-636
CheckAccess method, Registry Provider 1047-1048
child classes, WMI 463-465
child namespaces 445, 457
choosing a scripting language 12-13
CIM class definitions
accessing using SWbemObject 461
managed resource class definition structure 467
relationship to WMI scripting library Automation objects 480
retrieving using SWbemObject GetObjectText_ method 477-478
retrieving using SWbemObject properties 472-477
CIM classes
See also CIM class definitions; WMI classes
availability of 471-472
blueprint of WMI-managed environment 449-450
categories of classes 458
components of classes 466-467
core and common classes 459-460
extension classes 460-461
hierarchy and inheritance 463-465
importance of 446
listing classes in a namespace 461-463
methods 469
namespaces See namespaces
overview 441-442
properties 467-469
qualifiers 469-471
retrieving class definitions 472-478
system classes 458-459
types of classes 465-466
WMI Tester and 471
CIM Object Manager See CIMOM
CIM repository
as component of WMI infrastructure 435-436
blueprint of WMI-managed environment 449-450
browsing in, tools for 479
classes See CIM classes
event subscriptions stored in 543
location 442
namespaces See namespaces
overview 441-442, 446-449
queries See WMI queries
registering consumer classes in 545
relationship to WMI scripting library Automation objects 480
security 444
WMI provider registration 440
CIM Studio 479, 536
Cim.rep 442
CIM_DataFile class
Copy method 816
Delete method 817, 529
dynamic classes 460
methods 776-778
properties available in Windows Explorer interface 804
Rename method 813
CIM_DirectoryContainsFile class 460
file creation events, monitoring 821
file deletion events, monitoring 822
CIM_LogicalElement class 463
CIM_ManagedSystemElement class 463
CIM_ProcessExecutable class 460
CIM_Service class 463
CIM_VideoControllerResolution class 460
CIMOM
as component of WMI infrastructure 435-436
connecting to, remote access 440
overview 439-440
processing consumer requests 440
CIMType qualifier, WMI 470
cimv2 namespace 442, 450, 453
Cimwin32.dll 438-439
Cimwin32.mof 477
CInt function, VBScript 58
clarifying code See comments
Class argument, Create method, IADsContainer interface 557
class definitions, CIM See CIM class definitions
class list, Active Directory Schema Snap-in 403
Class property, IADs interface 423
class qualifiers, WMI 470
class store, CIM repository 441, 449
classes
Active Directory See Active Directory classes
CIM See CIM classes
WMI See WMI classes
__ClassOperationEvent class 536, 537
Clear method, VBScript 46
clearing event logs 852-855
clearing script output from Internet Explorer 1084
client-side network settings, managing with WMI scripts 430
CLng function, VBScript 58
Close method
Connection object, ADO 1105
FileSystemObject 285
Recordset object, ADO 1105
closing text files 284-285
CLSID, WMI 494
Cmd.exe, compared to WSH scripts 133
CN attribute type, distinguished names 324
CN attribute, Volume class 835
cn argument, Create method, IADsContainer interface 557
cn attribute
Computer class 691
printQueue object 933-935
user accounts 553
code
See also scripts
formatting See formatting code
readability See readability of code
CodeSet property, Win32_OperatingSystem class 639-641
coercion See type coercion
col (variable name prefix) 1153-1154
Collaboration Data Objects See CDO, e-mail messaging and
Collate property, Win32_PrinterConfiguration class 908-910
Collection (data subtype) 1153-1154
collections
See also arrays
Count property 33
determining number of items 33
For Each statement 31-32
iterating, VBScript 31-32
of installed drives, returning 244
overview 30-31
with zero items 33-34
WMI scripting vs. FileSystemObject 772
colon (:), in named arguments 164, 170
Color property, Win32_PrinterConfiguration class 908-910
colors in script output 1077, 1081-1084
columns in tabular script output
filtering data using tabular data control 1099
fixed-width columns in command window 1073
sorting data using tabular data control 1096
COM
Automation objects See Automation objects
Automation See COM Automation
COM clients 122
COM servers 122
in-process servers 122
objects See COM objects
out-of-process servers 122
overview 121
registration of COM servers 122
WSH support for 131
COM Automation
Automation objects See Automation objects
password masking and 1117
WMI and 430
COM clients 122
COM objects
See also Automation objects
applications without COM object model, automating 206-210
binding to 124
binding to using WScript object 150
CreateObject method, VBScript 124
CreateObject method, WSH vs. VBScript 153
creating 123
creating new instances of, WSH 151-152
dissociating object references 128
early binding 124
Embedded mode 123
error handling, VBScript 110-111
event-handling capabilities 153
GetObject method, VBScript 124
GetObject method, WSH vs. VBScript 153
interactions with WScript library 140
late binding 124
making applications visible 124
methods, calling 152
Nothing keyword, VBScript 128
object references See object references
properties, accessing 152
references See object references
remote object creation 153
Server mode 123
unloading from memory 127-128
using previously instantiated objects, WSH 152
VBScript and 18-19
verifying object references 126
within Shell object 774
WSH support for 131, 139
WshController object See WshController object
WshNetwork object See WshNetwork object
WshShell object See WshShell object
COM servers 122
command line
See also command window
arguments See command-line arguments
running WSH scripts 142-145
tools See command-line tools
Command object, ADO
Asynchronous property 380
Cache Results property 380
Chase Referrals property 367
CommandText property 589
in Active Directory searches 358
optimizing Active Directory searches 380
Page Size property 380
searching in Active Directory 589
Size Limit property 380
Sort On property 371
Time Limit property 380
Timeout property 380
Command property
Win32_ScheduledJob class 1137-1140, 1141-1142
Win32_StartupCommand class 674
command window
accepting user input 159-162
clearing 950
displaying data 950
displaying script output 154-159, 1072-1076
messages, displaying 159
StdErr stream See StdErr stream
StdIn stream See StdIn stream
StdOut stream See StdOut stream
streams See streams, input and output
tracking script progress 1133-1135
WScript Echo method 154-157
command-line arguments
accessing 167-168
Arguments property, WScript object 167
double quotation marks 164
filtering by WSH 164-165
for enterprise scripts, limitations of 1060
for enterprise scripts, text files as 1064
named and unnamed arguments in same script 172
named arguments 164, 170-171
naming 1150
overview 162
storage by WSH 164-165
storing in Dictionary object 296
unnamed arguments 164, 168-170
verifying correct number of arguments 172-173
verifying presence of required arguments 174-175
white space 164
WshArguments collection 164, 166-168
WshNamed collection 164, 170-171
WshUnnamed collection 164, 165, 168-170
command-line processor, specifying on command line 188-189
command-line tools
moving beyond shell scripting 11
parameters, spaces in 189-190
running from within scripts 132, 188-189
CommandLineEventConsumer class 545
CommandText property, Command object 589
comma-separated-value files
converting to arrays, VBScript 101-102
log files, parsing 877
saving script output for use with tabular data control 1092, 1096
comments
See also documenting code
comment delimiters 1178
extracting for script documentation 1181
formatting 1179
function and procedure headers 1180
general guidelines 1176-1178
overview 1175
removing debugging comments 1183
script headers 1179-1180
used as debugging aid 1182
common classes, WMI
See also WMI classes
overview 459-460
structure of CIM repository 450
Common Files folder
See also special folders
locating special folders 788
Common Information Model repository See CIM repository
Common-Name attribute, Computer class 691
company attribute, Computer class 691
CompareMode property, Dictionary object 297-298
Component Object Model See COM
Compress method
CIM_DataFile class 776-778
Win32_Directory class 776-778, 802
Compressed attribute
files 275
folders 258
Compressed property
Win32_Directory class 775-776
Win32_LogicalDisk class 733-734
compressing folders 802-803
compression, and disk quotas 748
CompressionMethod property
Win32_Directory class 775-776
Win32_DiskDrive class 726-728
computer accounts
See also computer roles
attributes, Computer class 691-693
attributes, configuring 703
attributes, enumerating 701-702
computer information, retrieving 693-694
copying 350
creating 695-697
current domain controller, identifying 718-719
deleting 698
deleting specified accounts 699
enabling 696
enumerating 709
locating based on attributes 710-711
logon information, retrieving 693-694
Microsoft Windows operating systems and 694-695
moving between OUs 705
overview 690
passwords, resetting 706-707
renaming 704-705
searching for in Active Directory 707-711
structuring in Active Directory 1070
computer assets, managing See asset management
Computer class 691, 693
computer configuration, determining
BIOS information 623-626
chassis type 634-636
installed hot fixes 645
inventorying computer hardware 629-636
latest installed service pack 643-644
operating system name and version number 637-638
operating system properties 639-641
SMBIOS information 628-629
system information 619-621
computer hardware See hardware
computer information
See also system information
retrieving in WSH scripts 226
computer roles
See also computer accounts
Active Directory-specific roles 716
computer accounts See computer accounts
current domain controller 718-719
domain controllers, enumerating 716-717
DomainRole property, Win32_ComputerSystem class 713
global catalog servers 722, 723-724
identifying 713-714
identifying based on installed services 715
operations master roles 719-721
overview 689, 712
ComputerName attribute, ADSystemInfo object 693
ComputerName property
Win32_NTLogEvent class 858-859
WshNetwork object 226
computers
accounts See computer accounts
as managed resources 436
listing in databases 1067
listing in text files 1061
logging off users 682-685
managing with WMI scripts 430
monitoring power status changes 686-688
multiple computers, running scripts on See enterprise scripts
recovery See disaster recovery
remote See remote computers, managing recovery options
restarting 685-686
retrieving names from Active Directory 1070
roles See computer roles
shutting down 682-685
specifying physical location 703
startup commands See startup commands
startup options See startup options
system requirements 13-14
trusting for delegation 663
COMSPEC (environment variable) 198
%comspec% environment variable 188-189
concatenating strings, VBScript 29-30
concatenating text files 288
conditional statements, VBScript
Case statement 96
If...Then...ElseIf statement 93-95
If.Then statement 37
If.Then.Else statement 38-39
logical AND operator 92
logical OR operator 93
Select Case statements 96-97
testing multiple conditions 92-97
conditions (loop conditions), checking 89-90
configuration container, binding to 392
Configuration object, CDO 1123
Configuration partition, Active Directory 406
configuring services
See also services
error control codes 1004-1005
parameters for service properties 1001-1003
service account passwords 1009-1010
specifying service accounts 1007-1008
start options 1003-1004
Win32_Service Change method 1001
connecting to CIMOM, remote access 440
connecting to databases
data source names (DSNs) 1104
scripting steps 1105-1107
connecting to namespaces 452-454, 484, 486
connecting to WMI
CIMOM security 440
namespace-level security 444
SWbemLocator object 484
SWbemServices object 486
WMI moniker 493
Connection object, ADO
Close method 1105
described 1103
in Active Directory searches 358, 589
Open method 1105
connections, printer See printer connections
consistency of variable names 1154-1155
constants
assigning strings to 26
compared to literal values 53
defining, VBScript 54
intrinsic constants, VBScript 54-56
naming conventions 1149, 1156
overview 25-26, 53
WMI Registry Provider, built-in constants 1022
WMI Registry Provider, method parameters 1027
consumer classes, WMI 545
Consumer property, __FilterToConsumerBinding class 546
consumers, WMI
See also WMI scripts
as layer of WMI architecture 435-436
overview 443
request processing by CIMOM 440
Contact user account 553
contactName attribute, printQueue object 933-935
containers, Active Directory
configuration container, binding to 392
enterprise scripts and 1070-1072
enumerating contents 386
enumerating contents to perform tasks on 387
enumerating objects of specific types 388
enumeration, managing user accounts 613-614
retrieving computer names from 1070-1072
schema container, binding to 392
searching for attributes 593, 596, 598
selecting for user account creation 556
context menu, Windows Explorer
adding script templates 1161
running WSH scripts 146
continuously-running scripts 89
CONTROL key, SendKeys representation 206
Control Panel folder
See also special folders
locating special folders 788
control structure statements, indenting for readability 1166-1167
controller scripts
See also remotely running scripts
overview 227
converting dates
standard to UTC 519-522, 784-786
UTC to standard 517
Cookies folder
See also special folders
locating special folders 788
Copies property, Win32_PrinterConfiguration class 908-910
Copy method
CIM_DataFile class 776-778, 816
Win32_Directory class 776-778, 796
CopyFile method, FileSystemObject 270-271
CopyFolder method, FileSystemObject 252-254
CopyHere method, Shell Folder object 798-799
copying
computer accounts 350
directory service objects 350-353
files 270-271, 816
folders and folder contents 252-254
folders using Shell Folder object 797-799
folders using WMI 796
folders with same name 798
user accounts 352, 581-583
Copying dialog box, displaying 798, 799
core classes, WMI
overview 459-460
structure of CIM repository 450
core interfaces, ADSI 422
correctness, testing scripts for 1188
Count method
verifying correct number of arguments 172
WshArguments collection 166
WshNamed collection 165
WshUnnamed collection 165
Count property
collections 33
Dictionary object 299
SWbemObjectSet collection 491
counters, as managed resources 436
CountryCode property, Win32_OperatingSystem class 639-641
Create method
ADSI 310-313, 326, 327-328
IADsContainer interface 557
Win32_Process class 959-960
Win32_ScheduledJob class 1141-1142
Win32_Service class 1011-1012
Win32_Share class 828-829
WMI classes 528
CreateFolder method, FileSystemObject 250, 251
CreateKey method, Registry Provider 1035
CreateObject method
Internet Explorer object 1077-1079
VBScript 20, 123, 124
WMI objects 483
Wscript object 1085
WScript object 150, 151, 153
WSH compared to VBScript 153
CreateScript method, WshController object 230
CreateShortcut method
WshShortcut object 192
WshUrlShortcut object 193
CreateTextFile method, FileSystemObject 280-281
creating directory service objects
See also directory service objects
binding to containers 312
committing changes to Active Directory 331
Create method parameters 327-328
creating objects 312
groups 311
mandatory attributes 313
object references 328
OUs 310
selecting object for binding 320-322
setting attribute values 313
user accounts 311
creating enterprise scripts See enterprise scripts
creating files, monitoring file creation events 821-822
creating processes
event subscriptions 943
monitoring 943-944
startup options 961-964
Win32_Process Create method 959-960
creating resources, WMI 528, 538, 542
creating scheduled tasks 1140-1143
creating scripts
See also scripts
introduction to scripting 3-6
creating user accounts
changing passwords 560
configuring passwords 558-560
Create method, IADsContainer interface 557
overview 555
scripting steps 311
selecting containers for account creation 556
setting passwords 559
specifying paths 556
verifying name uniqueness in domains 556
CreationDate property
Win32_Directory class 775-776, 784
Win32_PageFile class 763
credentials
coding into WMI scripts 485
impersonation See impersonation levels
required to run WMI scripts 443
Critical (error control code) 1004
crosshair mouse pointer, Internet Explorer 1130
crossRefContainer class, identifying operations master roles 719-721
CScript host
See also script hosts, WSH; WScript host; WSH scripts
command-line options 143-145
compared to WScript host 137-138
default script host, setting 143
determining current script host 180
input to scripts, accepting 159-162
logo, displaying or suppressing in script output 143
output from scripts, displaying 156-159
running scripts from command line 143-145
StdErr stream See StdErr stream
StdIn stream See StdIn stream
StdOut stream See StdOut stream
streams See streams, input and output
WScript Echo method 156-157
CSIDLs, identifying special folders 787
CSName property
Win32_Directory class 775-776
Win32_PageFile class 763
Win32_QuickFixEngineering class 645
CSng function, VBScript 58
CStr function, VBScript 58
CSV files
converting to arrays, VBScript 101-102
log files, parsing 877
saving script output for use with tabular data control 1092, 1096
cur (variable name prefix) 1153-1154
Currency (data subtype) 1153-1154
Currency values, VBScript, CCur type conversion function 58
current domain, binding to 391
current folder, binding to 250
current working directory, changing for scripts 211
CurrentDirectory property, WshShell object 211
CurrentLanguage property, Win32_BIOS class 624-626
CurrentUsage property, Win32_PageFileUsage class 764-765
cursor styles, mouse pointer in Internet Explorer 1130
CursorLocation property, Recordset object, ADO 1105
CursorType property, Recordset object, ADO 1105
custom event logs 874-875
Next
Last Updated: December 11, 2002
|