WMI Fun !! 〜 WMIに興味がある方・システム管理者必見!! 〜
 WMI Step|WMI Sample|WMI Reference|WMI Library|My Let'snote|Personal|Link|About WMI Fun !!

WMI Fun !! > WMI Library > Win32_Printer クラス

Panasonic Let'snoteを長年愛用しています、その理由はMy Let'snoteで…
インクを買うよりもしかしたら安い?インクジェット複合機HP Photosmart 5510
白いご飯や日本酒にもとても合うにしんのきりこみがマイブームです

Win32_Printer クラス - WMI Library

Win32_Printer クラスの説明

プリンターの LogicalDevice の機能と管理です。
WMI Providerは、CIMWin32です。
UUIDは、{8502C4BC-5FBB-11D2-AAC1-006008C78BC7}です。


プロパティ リスト

Attributes

Data Type: uint32
Access Type: Read Write

The Attributes property indicates the attributes of the Win32 printing device. These attributes are represented through a combination of flags. Attributes of the printer include:
Queued - Print jobs are buffered and queued.
Direct - Specifies that the document should be sent directly to the printer. This is used if print job are not being properly queued.
Default - The printer is the default printer on the computer.
Shared - Available as a shared network resource.
Network - Attached to the network.
Hidden - Hidden from some users on the network.
Local - Directly connected to this computer.
EnableDevQ - Enable the queue on the printer if available.
KeepPrintedJobs - Specifies that the spooler should not delete documents after they are printed.
DoCompleteFirst - Start jobs that are finished spooling first.
WorkOffline - Queue print jobs when printer is not available.
EnableBIDI - Enable bi-directional printing.
RawOnly - Allow only raw data type jobs to be spooled.
Published - Indicates whether the printer is published in the network directory service.



Availability

Data Type: uint16
Access Type: Read Only

デバイスの利用可能性と状態です。たとえば、Availability プロパティは、デバイスが実行中で通常の電力状態 (値 = 3) にあるか、警告 (4)、テスト中 (5)、低下 (10)、または省電力状態 (値 = 13-15 および 17) にあることを示します。省電力状態は次のように定義されています: 値 13 ("省電力 - 不明") は、デバイスが省電力モードになっていることは確かだが、省電力モードにおけるどの状態にあるかが不明であることを示します。値 14 ("省電力 - 低電力モード") は、デバイスが省電力状態になっているが機能しており、パフォーマンスは低下する場合があることを示します。値 15 ("省電力 - スタンバイ") は、デバイスが機能していないが、通常の電力での動作に 'すばやく' 移行できることを示します。値 17 ("省電力 - 警告") は、デバイスが警告状態になっているが、省電力モードでもあることを示します。



AvailableJobSheets

Data Type: string
Access Type: Read Only

プリンターで利用可能なすべてのジョブ シートを記述します。また、これは、場合によってプリンターが各ジョブの初めに出力することがある見出しの記述や、その他のユーザー指定オプションの記述にも使用できます。



AveragePagesPerMinute

Data Type: uint32
Access Type: Read Only

The AveragePagesPerMinute property specifies the rate (average number of pages per minute) that the printer is capable of sustaining.



Capabilities

Data Type: uint16
Access Type: Read Only

プリンター機能を示す整数の配列です。"両面印刷" (値 = 3) または "透明フィルム印刷" (7) などの情報がこのプロパティで指定されます。



CapabilityDescriptions

Data Type: string
Access Type: Read Only

Capabilities 配列で示されるプリンター機能の詳細説明を提供する自由形式文字列の配列です。注意: この配列の各エントリは、Capabilities 配列の同じインデックスに配置されているエントリに対応します。



Caption

Data Type: string
Access Type: Read Only

Caption プロパティは、オブジェクトを短いテキスト (1 行の文字列) で表した説明です。



CharSetsSupported

Data Type: string
Access Type: Read Only

プリンターの管理に関連するテキストの出力に利用可能な文字セットを示します。このプロパティで提供される文字列は、RFC 2046 (MIME Part 2) のセクション 4.1.2 ("Charset parameter") に指定されている語義と構文に従い、また、IANA 文字セット レジストリに含まれている必要があります。例: "utf-8"、"us-ascii" および "iso-8859-1"。



Comment

Data Type: string
Access Type: Read Write

The Comment property specifies the comment of a print queue.
Example: Color printer



ConfigManagerErrorCode

Data Type: uint32
Access Type: Read Only

Win32 構成マネージャーのエラー コードを示します。次の値が返されます:
0 このデバイスは正常に動作しています。
1 このデバイスは正しく構成されていません。
2 このデバイスのドライバーを読み込めません。
3 このデバイスのドライバーは壊れているか、あるいはメモリまたは他のリソースが不足している状態でシステムが実行されている可能性があります。
4 このデバイスは正常に動作していません。ドライバーつまたはレジストリが壊れている可能性があります。
5 このデバイスのドライバーには Windows が管理できないリソースが必要です。
6 このデバイスのブート構成が他のデバイスと競合しています。
7 フィルター処理できません。
8 デバイスのドライバー ローダーが見つかりません。
9 このデバイスを制御するファームウェアからリソースが正しく報告されないため、このデバイスは正常に動作していません。
10 このデバイスを開始できません。
11 このデバイスはエラーで停止しました。
12 このデバイスで使用できる十分な空きリソースが見つかりません。
13 このデバイスのリソースを確認できません。
14 コンピューターを再起動するまでこのデバイスは正常に動作しません。
15 このデバイスは、再列挙に問題が発生している可能性があり、正常に動作していません。
16 このデバイスで使用される一部のリソースを認識できません。
17 このデバイスは不明なリソースの種類を要求しています。
18 このデバイスのドライバーを再インストールしてください。
19 レジストリが壊れている可能性があります。
20 VxD ローダーの使用に失敗しました。
21 システム エラー: このデバイスのドライバーを変更してみてください。うまくいかない場合はハードウェアのマニュアルを参照してください。このデバイスは削除されます。
22 このデバイスは無効になっています。
23 システム障害: このデバイスのドライバーを変更してみてください。うまくいかない場合はハードウェアのマニュアルを参照してください。
24 このデバイスは存在しないか、正常に動作していないか、または一部のドライバーがインストールされていません。
25 このデバイスはまだセットアップ処理中です。
26 このデバイスはまだセットアップ処理中です。
27 このデバイスに有効なログ構成がありません。
28 このデバイスのドライバーはインストールされていません。
29 このデバイスは、必要なリソースがデバイスのファームウェアから提供されなかったため無効になっています。
30 このデバイスは、他のデバイスが使用している割り込み要求 (IRQ) リソースを使用しています。
31 このデバイスは、このデバイスに必要なドライバーを読み込めないため正常に動作していません。



ConfigManagerUserConfig

Data Type: boolean
Access Type: Read Only

デバイスがユーザー定義の構成を使用しているかどうかを示します。



CreationClassName

Data Type: string
Access Type: Read Only

CreationClassName は、インスタンスの作成で使用されるクラス名、またはサブクラス名を示します。このクラスの他のキー プロパティと一緒に使用すると、このクラスおよびそのサブクラスのインスタンスすべてがこのプロパティによって一意に識別されます。



CurrentCapabilities

Data Type: uint16
Access Type: Read Only

現在使用されている仕上がりおよびその他のプリンター機能の設定を指定します。このプロパティに含まれるエントリは、Capabilities 配列の一覧にも含まれている必要があります。



CurrentCharSet

Data Type: string
Access Type: Read Only

プリンターの管理に関連するテキストの出力に使用されている現在の文字セットを指定します。このプロパティによって記述される文字セットは、CharsetsSupported の一覧にも含まれている必要があります。このプロパティで指定される文字列は、RFC 2046 (MIME Part 2) のセクション 4.1.2 ("Charset parameter") に指定されている語義と構文に従い、また、IANA 文字セット レジストリに含まれている必要があります。例: "utf-8"、"us-ascii" および "iso-8859-1"。



CurrentLanguage

Data Type: uint16
Access Type: Read Only

現在使用中のプリンターの言語を示します。プリンターで使用される言語は LanguagesSupported の一覧にも含まれている必要があります。



CurrentMimeType

Data Type: string
Access Type: Read Only

MIME の種類を使用中であることが CurrentLanguage の設定で示されている場合 (値 = 47)、プリンターで現在使用されている MIME の種類を指定します。



CurrentNaturalLanguage

Data Type: string
Access Type: Read Only

プリンターで管理用に現在使用されている言語を示します。CurrentNaturalLanguage プロパティの一覧に含まれる言語は、NaturalLanguagesSupported の一覧にも含まれている必要があります。



CurrentPaperType

Data Type: string
Access Type: Read Only

プリンターが現在使用中の用紙の種類を指定します。文字列は RFC 1759 (Printer MIB) の Appendix C に要約されている ISO/IEC 10175 Document Printing Application (DPA) で指定されている形式で表記されなけばなりません。



Default

Data Type: boolean
Access Type: Read Only

The Default property indicates whether the printer is the default printer on the computer.



DefaultCapabilities

Data Type: uint16
Access Type: Read Only

既定で使用される仕上がりおよびその他のプリンター機能の設定を指定します。DefaultCapabilities に含まれるエントリは、Capabilities 配列の一覧にも含まれている必要があります。



DefaultCopies

Data Type: uint32
Access Type: Read Only

部数が指定されていない場合に単一のジョブで印刷される部数です。



DefaultLanguage

Data Type: uint16
Access Type: Read Only

プリンターの既定の言語を示します。プリンターに既定として使用される言語は LanguagesSupported の一覧にも含まれている必要があります。



DefaultMimeType

Data Type: string
Access Type: Read Only

MIME の種類を使用中であることが DefaultLanguage の設定で示されている場合 (値 = 47)、プリンターで使用される既定の MIME の種類を指定します。



DefaultNumberUp

Data Type: uint32
Access Type: Read Only

ジョブで指定されていない場合にプリンターが単一のメディア シート上に出力する印刷ストリームのページ数です。



DefaultPaperType

Data Type: string
Access Type: Read Only

印刷ジョブで特定の種類が指定されない場合にプリンターで使用する用紙の種類を指定します。文字列は RFC 1759 (Printer MIB) の Appendix C に要約されている ISO/IEC 10175 Document Printing Application (DPA) で指定されている形式で表記されなければなりません。



DefaultPriority

Data Type: uint32
Access Type: Read Write

The DefaultPriority property specifies the default priority value assigned to each print job.



Description

Data Type: string
Access Type: Read Only

Description プロパティは、オブジェクトの説明を提供します。



DetectedErrorState

Data Type: uint16
Access Type: Read Only

プリンター エラー情報です。



DeviceID

Data Type: string
Access Type: Read Only

DeviceID は論理デバイスを一意に特定するためのアドレスまたは他の識別情報です。



Direct

Data Type: boolean
Access Type: Read Write

The Direct property indicates whether the print jobs should be sent directly to the printer. This means that no spool files are created for the print jobs.



DoCompleteFirst

Data Type: boolean
Access Type: Read Write

The DoCompleteFirst property indicates whether the printer should start jobs that have finished spooling as opposed to the order of the job received.



DriverName

Data Type: string
Access Type: Read Write

The DriverName property specifies the name of the Win32 printer driver.
Example: Windows NT Fax Driver



EnableBIDI

Data Type: boolean
Access Type: Read Write

The EnableBIDI property indicates whether the printer can print bidirectionally.



EnableDevQueryPrint

Data Type: boolean
Access Type: Read Write

The EnableDevQueryPrint property indicates whether to hold documents in the queue, if document and printer setups do not match



ErrorCleared

Data Type: boolean
Access Type: Read Only

ErrorCleared は LastErrorCode プロパティで報告されたエラーが現在解決されているかどうかを示すブール値のプロパティです。



ErrorDescription

Data Type: string
Access Type: Read Only

ErrorDescription は、LastErrorCode プロパティに記録されたエラーに関する詳細情報およびそれに対する修正アクションに関する情報を提供する自由形式の文字列です。



ErrorInformation

Data Type: string
Access Type: Read Write

DetectedErrorState で示される現在のエラー状態について補足情報を提供する配列です。



ExtendedDetectedErrorState

Data Type: uint16
Access Type: Read Only

The ExtendedDetectedErrorState property reports standard error information. Any additional information should be recorded in the DetecteErrorState property.



ExtendedPrinterStatus

Data Type: uint16
Access Type: Read Only

Status information for a Printer, beyond that specified in the LogicalDevice Availability property. Values include "Idle" (3) and an indication that the Device is currently printing (4).



Hidden

Data Type: boolean
Access Type: Read Write

The Hidden property indicates whether the printer is hidden from network users.



HorizontalResolution

Data Type: uint32
Access Type: Read Only

プリンターの水平方向の解像度 (ピクセル/インチ) です。



InstallDate

Data Type: datetime
Access Type: Read Only

InstallDate プロパティは、オブジェクトがいつインストールされたかを示す datetime 値です。値がなくても、オブジェクトがインストールされていないことを示すわけではありません。



JobCountSinceLastReset

Data Type: uint32
Access Type: Read Only

前回のリセット後に処理された印刷ジョブです。これらのジョブは 1 つ以上の PrintQueues から処理されている可能性があります。



KeepPrintedJobs

Data Type: boolean
Access Type: Read Write

The KeepPrintedJobs property indicates whether the print spooler should not delete the jobs after they are completed.



LanguagesSupported

Data Type: uint16
Access Type: Read Only

ネイティブでサポートされている印刷言語を示す配列です。



LastErrorCode

Data Type: uint32
Access Type: Read Only

LastErrorCode には、その論理デバイスで最後に報告されたエラー コードが記録されています。



Local

Data Type: boolean
Access Type: Read Write

The Local property indicates whether the printer is attached to the network. A masquerading printer is printer that is implemented as local printers but has a port that refers to a remote machine. From the application perspective these hybrid printers should be viewed as printer connections since that is their intended behavior.



Location

Data Type: string
Access Type: Read Write

The Location property specifies the physical location of the printer.
Example: Bldg. 38, Room 1164



MarkingTechnology

Data Type: uint16
Access Type: Read Only

プリンターで使用される印字テクノロジを指定します。



MaxCopies

Data Type: uint32
Access Type: Read Only

単一のジョブでプリンターから印刷できる最大部数です。



MaxNumberUp

Data Type: uint32
Access Type: Read Only

プリンターが単一のメディア シート上に出力できる印刷ストリームの最大ページ数です。



MaxSizeSupported

Data Type: uint32
Access Type: Read Only

プリンターが受け付けるジョブの (バイト ストリームとしての) 最大サイズを指定します (KB)。値 0 は制限が設定されていないことを示します。



MimeTypesSupported

Data Type: string
Access Type: Read Only

プリンターでサポートされている MIME の種類に関する詳細な情報を提供する自由形式の文字列の配列です。このプロパティにデータが提供されている場合は、値 47 の "Mime" が LanguagesSupported プロパティに含まれていなければなりません。



Name

Data Type: string
Access Type: Read Only

Name プロパティは、オブジェクトを認識するためのラベルを定義します。サブクラスでは、Name プロパティは上書きされて Key プロパティになることがあります。



NaturalLanguagesSupported

Data Type: string
Access Type: Read Only

プリンターで管理情報の出力用に使用される文字列に利用可能な言語を示します。これらの文字列は RFC 1766 に従う必要があります。たとえば、英語は "en" で表されます。



Network

Data Type: boolean
Access Type: Read Write

The Network property indicates whether the printer is a network printer.



PaperSizesSupported

Data Type: uint16
Access Type: Read Only

サポートされる用紙の種類を示す整数の配列です。



PaperTypesAvailable

Data Type: string
Access Type: Read Only

プリンターで現在利用可能な用紙の種類を指定する自由形式の文字列の配列です。各文字列は RFC 1759 (Printer MIB) の Appendix C に要約されている ISO/IEC 10175 Document Printing Application (DPA) で指定されている形式で表記されなければなりません。有効な文字列は、たとえば "iso-a4-colored" および "na-10x14-envelope" などです。定義により、PaperTypesAvailable の一覧にある利用可能な用紙のサイズは PaperSizesSupported プロパティにも含まれている必要があります。



Parameters

Data Type: string
Access Type: Read Write

The Parameters property specifies optional parameters for the print processor.
Example: Copies=2



PNPDeviceID

Data Type: string
Access Type: Read Only

論理デバイスの Win32 プラグ アンド プレイ デバイス ID を示します。例: *PNP030b



PortName

Data Type: string
Access Type: Read Write

The PortName property identifies the ports that can be used to transmit data to the printer. If a printer is connected to more than one port, the names of each port are separated by commas. Under Windows 95, only one port can be specified.
Example: LPT1:, LPT2:, LPT3:



PowerManagementCapabilities

Data Type: uint16
Access Type: Read Only

論理デバイスの具体的な電源関連機能を示します。0="不明"、1="サポートされていません"、および 2="無効" は文字どおりの意味です。3="有効" は、電源管理機能は現在有効であるが、正確な機能セットが不明か、または情報を取得できないことを示します。"自動省電力モード" (4) は、使用状況または他の条件に基づいてデバイスが電源の状態を変更できることを示します。"電源の状態設定可能" (5) は、SetPowerState メソッドがサポートされていることを示します。"電源サイクル サポート" (6) は、SetPowerState メソッドの PowerState 入力変数に 5 ("電源サイクル") を設定して呼び出せることを示します。"時刻指定電源オン サポート" (7) は、SetPowerState メソッドの PowerState 入力変数に 5 ("電源サイクル") を設定し、Time パラメーターに電源オンの具体的な日時または時間間隔を設定して呼び出せることを示します。



PowerManagementSupported

Data Type: boolean
Access Type: Read Only

デバイスの電源管理が可能である (省電力状態に移行できる) ことを示すブール値です。電源管理機能が現在有効であるかどうかや、有効である場合にどの機能がサポートされるかを示す値ではありません。そうした情報については PowerManagementCapabilities 配列を参照する必要があります。このブール値が false の場合、PowerManagementCapabilities 配列には、文字列 "サポートされていません" を示す整数値 1 のエントリだけが含まれます。



PrinterPaperNames

Data Type: string
Access Type: Read Only

The PrinterPaperNames property indicates the list of paper sizes supported by the printer. The printer-specified names are used to represent supported paper sizes.
Example: B5 (JIS).



PrinterState

Data Type: uint32
Access Type: Read Only

This property has been deprecated in favor of PrinterStatus, DetectedErrorState and ErrorInformation CIM properties that more clearly indicate the state and error status of the printer. The PrinterState property specifies a values indicating one of the possible states relating to this printer.



PrinterStatus

Data Type: uint16
Access Type: Read Only

論理デバイスの Availability プロパティで指定されたプリンターの状態よりも詳細な情報です。値には "アイドル" (3) およびデバイスが現在印刷中であることを示す (4) が含まれています。



PrintJobDataType

Data Type: string
Access Type: Read Write

The PrintJobDataType property indicates the default data type that will be used for a print job.



PrintProcessor

Data Type: string
Access Type: Read Write

The PrintProcessor property specifies the name of the print spooler that handles print jobs.
Example: SPOOLSS.DLL.



Priority

Data Type: uint32
Access Type: Read Write

The Priority property specifies the priority of the printer. The jobs on a higher priority printer are scheduled first.



Published

Data Type: boolean
Access Type: Read Write

The Published property indicates whether the printer is published in the network directory service.



Queued

Data Type: boolean
Access Type: Read Write

The Queued property indicates whether the printer buffers and queues print jobs.



RawOnly

Data Type: boolean
Access Type: Read Write

The RawOnly property indicates whether the printer accepts only raw data to be spooled.



SeparatorFile

Data Type: string
Access Type: Read Write

The SeparatorFile property specifies the name of the file used to create a separator page. This page is used to separate print jobs sent to the printer.



ServerName

Data Type: string
Access Type: Read Only

The ServerName property identifies the server that controls the printer. If this string is NULL, the printer is controlled locally.



Shared

Data Type: boolean
Access Type: Read Write

The Shared property indicates whether the printer is available as a shared network resource.



ShareName

Data Type: string
Access Type: Read Write

The ShareName property indicates the share name of the Win32 printing device.
Example: \\PRINTSERVER1\PRINTER2



SpoolEnabled

Data Type: boolean
Access Type: Read Only

The SpoolEnabled property shows whether spooling is enabled for this printer.
Values:TRUE or FALSE.
The SpoolEnabled property has been deprecated. There is no replacementvalue and this property is now considered obsolete.



StartTime

Data Type: datetime
Access Type: Read Write

The StartTime property specifies the earliest time the printer can print a job (if the printer has been limited to print only at certain times). This value is expressed as time elapsed since 12:00 AM GMT (Greenwich mean time).



Status

Data Type: string
Access Type: Read Only

Status プロパティはオブジェクトの現在の状態を示す文字列です。操作可能な状態および操作不可能な状態が定義されます。操作可能な状態は、"OK"、"低下" および "障害が発生する可能性あり" です。"障害が発生する可能性あり" は、要素は適切に機能するけれども近いうちに障害が発生する可能性があることを示します。例: SMART 対応ハード ディスク。操作不可能な状態も指定できます。これは、"エラー"、"開始中"、"停止動作中" および "サービス" です。最後の "サービス" には、ディスクがミラーされている間、ユーザーのアクセス許可の一覧を再度読み込む間、または他の管理用作業が行われている間などが該当します。この作業がすべてオンラインで行われるとは限りませんが、[管理要素] は "OK" でも他の状態でもありません。



StatusInfo

Data Type: uint16
Access Type: Read Only

StatusInfo は、論理デバイスが有効 (値 = 3)、無効 (値 = 4)、その他の状態 (1) または不明な状態 (2) であることを示す文字列です。このプロパティが論理デバイスに適用されない場合は、値 5 ("該当なし") が使用されます。



SystemCreationClassName

Data Type: string
Access Type: Read Only

スコーピング システムの CreationClassName です。



SystemName

Data Type: string
Access Type: Read Only

スコーピング システムの名前です。



TimeOfLastReset

Data Type: datetime
Access Type: Read Only

プリンター デバイスの前回のリセットの時刻です。



UntilTime

Data Type: datetime
Access Type: Read Write

The UntilTime property specifies the latest time the printer can print a job (if the printer has been limited to print only at certain times). This value is expressed as time elapsed since 12:00 AM GMT (Greenwich mean time).



VerticalResolution

Data Type: uint32
Access Type: Read Only

プリンターの垂直方向の解像度 (ピクセル/インチ) です。



WorkOffline

Data Type: boolean
Access Type: Read Write

The WorkOffline property indicates whether to queue print jobs on the computer if the printer is offline.




メソッド リスト

SetPowerState

SetPowerState は、論理デバイスに対して希望する電源状態と、デバイスをいつその状態にするかを定義します。電源状態は、1="通常の電力"、2="省電力 - 低電力モード"、3="省電力 - スタンバイ"、4="省電力 - その他"、5="電源サイクル" または 6="電源オフ" のいずれかの整数値を PowerState パラメーターに設定することで指定します。Time パラメーターには、(5 の "電源サイクル" を除くすべての状態変更について) 電源状態を設定するときを示す標準の日付時刻値または間隔値 (メソッド呼び出しが受信された時点からの経過時間) を指定します。PowerState パラメーターが 5 の "電源サイクル" の場合、Time パラメーターには、システムをもう一度電源オンにするときを指定します。電源オフは直ちに実行されます。SetPowerState は、成功した場合は 0 を返し、指定した PowerState および要求時間がサポートされていない場合は 1 を返し、その他のエラーが発生した場合は別の値を返します。サブクラスでは、メソッドに ValueMap 修飾子を使用して可能なリターン コードのセットを指定できる場合があります。また、サブクラスでは、ValueMap の内容を '翻訳' した文字列を Values 配列修飾子として指定できる場合があります。


Reset

論理デバイスのリセットを要求します。要求が正常に実行された場合、返される値は 0 で、要求がサポートされない場合は 1 です。また、エラーが発生した場合は他の値となります。


Pause

The Pause method pauses the print queue. No jobs can print anymore until the print queue is resumed. The method can return the following values:
0 - Success.
5 - Access denied.
Other - For integer values other than those listed above, refer to the documentation on the Win32 error codes.


Resume

The Resume method resumes a paused print queue. The method can return the following values:
0 - Success.
5 - Access denied.
Other - For integer values other than those listed above, refer to the documentation on the Win32 error codes.


CancelAllJobs

The CancelAllJobs method cancels and removes all print jobs from the printer queue including the job currently printing. The method can return the following values:
0 - Success.
5 - Access denied.
Other - For integer values other than those listed above, refer to the documentation on the Win32 error codes.


AddPrinterConnection

The AddPrinterConnection method provides a connection to an existing printer on the network and adds it to the list of available printers on the computer system. If successful, applications will be able to use this printer for print jobs. If unsuccessful the printer is not installed. The method can return the following values:
0 - Success.
5 - Access denied.
1801 - Invalid printer name.
1930 - Incompatible printer driver.
Other - For integer values other than those listed above, refer to the documentation on the Win32 error codes.


RenamePrinter

The RenamePrinter method renames a printer. The method can return the following values:
0 - Success.
5 - Access denied.
1801 - Invalid printer name.
Other - For integer values other than those listed above, refer to the documentation on the Win32 error codes.


PrintTestPage

The PrintTestPage method prints a test page. The method can return the following values:
0 - Success.
5 - Access denied.
Other - For integer values other than those listed above, refer to the documentation on the Win32 error codes.


SetDefaultPrinter

The SetDefaultPrinter method sets the printer to be the default printer for the user who executes the method. The method can return the following values:
0 - Success.
Other - For integer values other than those listed above, refer to the documentation on the Win32 error codes.


GetSecurityDescriptor

Retrieves a structural representation of the printer's security descriptor.
The method returns an integer value that can be interpreted as follows:
0 - Successful completion.
2 - The user does not have access to the requested information.
8 - Unknown failure.
9 - The user does not have adequate privileges.
21 - The specified parameter is invalid.
Other - For integer values other than those listed above, refer to Win32 error code documentation.


SetSecurityDescriptor

Sets security descriptor on the printer to the specified structure.
The method returns an integer value that can be interpreted as follows:
0 - Successful completion.
2 - The user does not have access to the requested information.
8 - Unknown failure.
9 - The user does not have adequate privileges.
21 - The specified parameter is invalid.
Other - For integer values other than those listed above, refer to Win32 error code documentation.



WQL サンプル

SELECT * FROM Win32_Printer

VB6/VBS
SWbemServicesクラスのExecQueryメソッドからWQLを実行可能です。
Set PrcSet = Service.ExecQuery("SELECT * FROM Win32_Printer")

VB.Net
ObjectQueryクラスのQueryStringプロパティにWQLを設定し、ManagementObjectSearcherクラスのGetメソッドからWQLを実行可能です。
Searcher.Query.QueryString = "SELECT * FROM Win32_Printer"
PrcSrc = Searcher.Get

PowerShell
Get-WmiObjectコマンドレットのqueryオプションを指定しWQLを実行可能です。
Get-WmiObject -query "SELECT * FROM Win32_Printer"


このサイトの情報について

このコンテンツはWMIの各コンポーネントが持っているWin32_Printerクラス情報を参照・抽出しリファレンスとして作成・提供しています。
参照したWMIの名前空間はroot/CIMV2、書き出し環境はWindows Server 2008 R2になります。

WMIの使い方(VB6, VBS, VBA, VB.NET, VC#, PowerShellを対象)に関してはWMI Stepも参考にしてみてください。(WMI初心者・入門編としてもおすすめです。) 各種言語を使用したWMIを使用するたたき台としてソーステンプレートも公開しています。プログラム/スクリプト作成時に役立てば…と思っています。

今後各WMI ClassをサポートしているOSの種類を掲載する予定です。
予定OS: Windows XP/Windows Vista/Windows 7/Windows Server 2003/Windows Server 2003 R2/Windows Server 2008/Windows Server 2008 R2


ご意見・ご要望・ご感想をこちらのアンケートからお待ちしています
WMIに関して調べているけど探し物が見つからない…という方はSearch Resultから検索してみましょう!!

MCP(Microsoft Certified Professional)一応MCP(Microsoft Certified Professional)、MCA(Microsoft Certified Associate)所有してたりします…

- WMI Fun !! -
http://www.wmifun.net/
Microsoft社のテクノロジーであるWMI(Windows Management Instrumentation)の使い方を
Visual Basicを使ってのんびり公開しています
WMIはVB/VBAや.Net(VB,C#)以外でもWMICやWSH(VBS,JS)・PowerShellなどスクリプト言語からも使えますよ!
Windowsベースの社内ITシステムに関する資産管理、アセットマネジメントや監視業務の効率化、
インベントリ情報収集系システムツール開発にWMIはお勧めです

This website is created by Toh.
Copyright(C) 1997-2012 WMI Fun !!. All rights reserved.
WMI Fun !!へのリンクはご自由に…相互リンクに関するお問い合わせはアンケートページからお願いします。

∧ ページの先頭へ…