The first two approaches are intended for information technology (IT) professionals. The third approach is intended for developers who want to create custom tools to configure AD FS 2.0. This topic describes the third approach.

The AD FS 2.0 API provides command classes for each Windows PowerShell cmdlet, and it provides resource classes for the parameters and return values. The command classes extend the abstract System.Management.Automation.Cmdlet class.

Right-click the unloaded project again, and click Reload Project. You should see the System.Management.Automation assembly in the References folder in your Solution Explorer.

Example: Adding a New Relying Party Trust

The following code sample shows how to add a new relying party trust with www.contoso.com using a metadata URL. Next, it lists all configured relying party trusts. Finally, it removes the www.contoso.com relying party trust.