共用方式為


Using Windows PowerShell to Administer AD RMS

Updated: October 22, 2009

Applies To: Windows Server 2008 R2, Windows Server 2008 R2 with SP1

The Active Directory Rights Management Services (AD RMS) Windows PowerShell administration module gives you the ability to administer all aspects of an AD RMS cluster by using Windows PowerShell cmdlets. The provider in the administration module presents a drive namespace that is based on the organization of cluster settings that is shown by the AD RMS graphical user interface (GUI). Within this namespace, you manage cluster settings by creating and setting properties on items in the containers that are arranged hierarchically in the namespace, most often by using common Windows PowerShell cmdlets, such as New-Item and Set-ItemProperty. In some cases, the AD RMS Windows PowerShell administration module implements special-purpose cmdlets to perform tasks that cannot be performed by using common cmdlets.

Note

The AD RMS Windows PowerShell administration module does not support the 32-bit version of Windows PowerShell. It can only be used on the 64-bit version.

Getting started

Before you can administer AD RMS by using Windows PowerShell cmdlets, after starting Windows PowerShell, you must perform three tasks:

  1. Import the AD RMS Windows PowerShell administration module.

  2. Create a Windows PowerShell drive that represents the AD RMS cluster you want to administer.

  3. Set the current location to a container on the drive you created.

The following procedures explain how to perform each of these tasks.

Import the module

  • At the Windows PowerShell prompt, type:

    Import-Module AdRmsAdmin

Create the drive

  • At the Windows PowerShell prompt, type:

    New-PSDrive -Name<drivename> -PsProvider AdRmsAdmin -Root<clusterURL>

    where <drivename> is the name you want to assign to the new drive, and <clusterURL> is the URL of the AD RMS cluster you want to administer.

    For example, to create a drive named AdrmsCluster that represents the AD RMS cluster hosted by the local computer, type:

    New-PSDrive -Name AdrmsCluster -PsProvider AdRmsAdmin -Root https://localhost

Set the current location

  • At the Windows PowerShell command prompt, type:

    Set-Location<drivename>:\[<container>]

    where <drivename> is the name of the drive, and <container> is the optional path name of container within the drive. For information about how to use these containers, see Understanding the AD RMS Administration Provider Namespace.

    For example, to set the current location to the TrustPolicy\TrustedPublishingDomain container in the AdrmsCluster drive, type:

    Set-Location AdrmsCluster:\TrustPolicy\TrustedPublishingDomain

See Also

Concepts

Understanding the AD RMS Administration Provider Namespace
AD RMS Administration Cmdlets
Installing Microsoft Federation Gateway Support
Configuring AD RMS Cluster Properties
Administering Certificates
Enabling Exclusion Policies
Establishing Trust Policies
Managing AD RMS Databases
Configuring Accounts
Configuring Rights Policy Templates
Working with Reports
Decommissioning AD RMS