PrintSystemDesiredAccess 列挙型

定義

印刷オブジェクトに対してさまざまなアクセス権 (またはアクセスのレベル) を指定します。

public enum class PrintSystemDesiredAccess
public enum PrintSystemDesiredAccess
type PrintSystemDesiredAccess = 
Public Enum PrintSystemDesiredAccess
継承
PrintSystemDesiredAccess

フィールド

AdministratePrinter 983052

印刷ジョブを一時停止および再開する権限などの、印刷キューのすべての管理タスクを実行する権限、およびキューからすべてのジョブを削除する権限。 このアクセス レベルには、UsePrinter のすべての権限も含まれます。

AdministrateServer 983041

プリント サーバーのすべての管理タスクを実行する権限。 このアクセス レベルには、サーバーによってホストされている印刷キューに対する AdministratePrinter 権限は含まれません

EnumerateServer 131074

プリント サーバーのキューを一覧表示する権限。

None 0

アクセスできません。

UsePrinter 131080

印刷ジョブをキューに追加する権限と独自のジョブを削除および列挙する権限。

次の例では、この列挙体を使用して、場所、ポート、および共有状態でのみ、そのプロパティと既存のプリンターと異なる 2 番目のプリンターをインストールする方法を示します。

LocalPrintServer myLocalPrintServer = new LocalPrintServer(PrintSystemDesiredAccess.AdministrateServer);
PrintQueue sourcePrintQueue = myLocalPrintServer.DefaultPrintQueue;
PrintPropertyDictionary myPrintProperties = sourcePrintQueue.PropertiesCollection;

// Share the new printer using Remove/Add methods
PrintBooleanProperty shared = new PrintBooleanProperty("IsShared", true);
myPrintProperties.Remove("IsShared");
myPrintProperties.Add("IsShared", shared);

// Give the new printer its share name using SetProperty method
PrintStringProperty theShareName = new PrintStringProperty("ShareName", "\"Son of " + sourcePrintQueue.Name +"\"");
myPrintProperties.SetProperty("ShareName", theShareName);

// Specify the physical location of the new printer using Remove/Add methods
PrintStringProperty theLocation = new PrintStringProperty("Location", "the supply room");
myPrintProperties.Remove("Location");
myPrintProperties.Add("Location", theLocation);

// Specify the port for the new printer
String[] port = new String[] { "COM1:" };

// Install the new printer on the local print server
PrintQueue clonedPrinter = myLocalPrintServer.InstallPrintQueue("My clone of " + sourcePrintQueue.Name, "Xerox WCP 35 PS", port, "WinPrint", myPrintProperties);
myLocalPrintServer.Commit();

// Report outcome
Console.WriteLine("{0} in {1} has been installed and shared as {2}", clonedPrinter.Name, clonedPrinter.Location, clonedPrinter.ShareName);
Console.WriteLine("Press Return to continue ...");
Console.ReadLine();
Dim myLocalPrintServer As New LocalPrintServer(PrintSystemDesiredAccess.AdministrateServer)
Dim sourcePrintQueue As PrintQueue = myLocalPrintServer.DefaultPrintQueue
Dim myPrintProperties As PrintPropertyDictionary = sourcePrintQueue.PropertiesCollection

' Share the new printer using Remove/Add methods
Dim [shared] As New PrintBooleanProperty("IsShared", True)
myPrintProperties.Remove("IsShared")
myPrintProperties.Add("IsShared", [shared])

' Give the new printer its share name using SetProperty method
Dim theShareName As New PrintStringProperty("ShareName", """Son of " & sourcePrintQueue.Name & """")
myPrintProperties.SetProperty("ShareName", theShareName)

' Specify the physical location of the new printer using Remove/Add methods
Dim theLocation As New PrintStringProperty("Location", "the supply room")
myPrintProperties.Remove("Location")
myPrintProperties.Add("Location", theLocation)

' Specify the port for the new printer
Dim port() As String = { "COM1:" }


' Install the new printer on the local print server
Dim clonedPrinter As PrintQueue = myLocalPrintServer.InstallPrintQueue("My clone of " & sourcePrintQueue.Name, "Xerox WCP 35 PS", port, "WinPrint", myPrintProperties)
myLocalPrintServer.Commit()

' Report outcome
Console.WriteLine("{0} in {1} has been installed and shared as {2}", clonedPrinter.Name, clonedPrinter.Location, clonedPrinter.ShareName)
Console.WriteLine("Press Return to continue ...")
Console.ReadLine()

注釈

各アクセス レベルで使用できるアクセス権は、次のように異なります。

  • プリント サーバーがコンピューターかプリント サーバー アプライアンスか。

  • 使用されるオペレーティング システム。

  • インストールされているセキュリティ更新プログラム。

  • サポートされているセキュリティ ポリシー。

このため、[メンバー] セクションのアクセス権の説明は、各アクセス レベルに対応する権限の一般的なものですが、一覧表示されているアクセス レベルによって、特定のシステムに対する権限が増減する場合があります。

これらの値は、主に および PrintQueue コンストラクターのPrintServerパラメーターとして使用されます。 別の種類のオブジェクトにのみ適用できる値を使用すると、コンストラクターは例外をスローします。 たとえば、AdministratePrinter をコンストラクターに PrintServer 渡さないでください。

適用対象