次の方法で共有


Application.GetGroupApplicationGroup メソッド (Microsoft.SharePoint.Portal.SingleSignon)

グループの企業アプリケーション定義に関連付けられた Microsoft Windows NT の Domain\Group アカウントを取得します。

名前空間: Microsoft.SharePoint.Portal.SingleSignon
アセンブリ: Microsoft.SharePoint.Portal.SingleSignon (microsoft.sharepoint.portal.singlesignon.dll 内)

構文

'宣言
<SingleSignonPermissionAttribute(SecurityAction.Demand, Access:=SingleSignonAccess.Minimal)> _
Public Shared Sub GetGroupApplicationGroup ( _
    strApplicationName As String, _
    ByRef strGroupName As String _
)
'使用
Dim strApplicationName As String
Dim strGroupName As String

Application.GetGroupApplicationGroup(strApplicationName, strGroupName)
[SingleSignonPermissionAttribute(SecurityAction.Demand, Access=SingleSignonAccess.Minimal)] 
public static void GetGroupApplicationGroup (
    string strApplicationName,
    ref string strGroupName
)

パラメータ

  • strApplicationName
    この NT の Domain\Group アカウント名に関連付けられた企業アプリケーション定義の名前。これは企業アプリケーション定義のフレンドリ名ではありません。使用できる文字数は最大 128 文字です。
  • strGroupName
    SSO グループ名。

備考

Microsoft シングル サインオン サービス (SSOSrv) には、2 つの企業アプリケーション定義の型があります。グループ アプリケーションおよび個々のアプリケーションです。グループ アプリケーション型には GetGroupApplicationGroup メソッドを使用します。指定されたアプリケーション定義名がグループ アプリケーションではない場合、Application Not Found エラーが返されます。指定されたアプリケーション定義名がグループ アプリケーションで資格情報が設定されていない場合は、NULL が返されます。

シングル サインオン管理グループのメンバまたはアプリケーション管理者のみが GetGroupApplicationGroup メソッドを使用できます。

GetGroupApplicationGroup メソッドの各呼び出しの結果は監査され、シングル サインオン データベースに保存されます。記録される ServiceAction 列挙は、GetApplication です。

次のコード例は、GetGroupApplicationGroup メソッドの使用法を示しています。この例を使用するには、domain_name\\group_name をネットワーク上の有効なドメインおよびグループで置き換えます。

 [C#]
using System;
using Microsoft.SharePoint.Portal.SingleSignon;

namespace SSOSampleCode
{
/// <summary>
/// Sample code for SharePoint Portal Single SignOn.
/// </summary>
class CMainEntry
{
            [STAThread]
            static void Main(string[] args)
            {
                try
                {
                    //Create the application fields (max 5 fields).
                    Application.ApplicationField[] rgFields = new Application.ApplicationField[5];

                    rgFields[0] = new Application.ApplicationField(
                        "Field1 Label",  //Application field name
                        true);           //true == mask in the UI, false == don't mask in the UI

                    rgFields[1] = new Application.ApplicationField(
                        "Field2 Label",
                        false);

                    rgFields[2] = new Application.ApplicationField(
                        "Field3 Label",
                        true);

                    rgFields[3] = new Application.ApplicationField(
                        "Field4 Label",
                        false);

                    rgFields[4] = new Application.ApplicationField(
                        "Field5 Label",
                        true);

                    //Create group application information data.
                    Application.ApplicationInfo App = new Application.ApplicationInfo(
                        "MyGroupApplicationID",
                        "My Group Applicaiton Display Name",
                        Application.ApplicationType.Group,
                        "someone@someplace.someext");
                    //Now, add the application
                    Application.AddApplication(
                        App,
                        rgFields,
                        Application.ApplicationCreationDisposition.CreateNew);

                    Console.WriteLine("Successfully added the group application!");

                    //Next, add credentials for this group application.
                    string[] rgCredentialsData = new string[5];

                    rgCredentialsData[0] = "Data for field1";
                    rgCredentialsData[1] = "Data for field2";
                    rgCredentialsData[2] = "Data for field3";
                    rgCredentialsData[3] = "Data for field4";
                    rgCredentialsData[4] = "Data for field5";

                    Credentials.SetGroupCredentials(
                        "MyGroupApplicationID",
                        "domain_name\\group_name",
                        rgCredentialsData);
                    Console.WriteLine("Successfully added credentials to the group application");

                    //Get the group applications associated group account name.
                    string strGroupName = null;
                    Application.GetGroupApplicationGroup(
                        "MyGroupApplicationID",
                        ref strGroupName);

                    Console.WriteLine("Group account associated with this application is: " + strGroupName);
                }
                catch (SingleSignonException esso)
                {
                    Console.WriteLine("SingleSignonException caught.");
                    Console.WriteLine("Exception Code: " + "0x" + esso.LastErrorCode.ToString("x"));
                    Console.WriteLine("Source: " + esso.Source);
                    Console.WriteLine("StackTrace: " + esso.StackTrace);
                    Console.WriteLine("MethodName: " + esso.TargetSite.Name);
                    Console.WriteLine("Message: " + esso.Message);
                }
                catch (Exception e)
                {
                    Console.WriteLine("Exception caught.");
                    Console.WriteLine("Source: " + e.Source);
                    Console.WriteLine("StackTrace: " + e.StackTrace);
                    Console.WriteLine("MethodName: " + e.TargetSite.Name);
                    Console.WriteLine("Message: " + e.Message);
                }
            }
    }
}

関連項目

参照

Application クラス
Application メンバ
Microsoft.SharePoint.Portal.SingleSignon 名前空間