Server.IsWindowsGroupMember メソッド

指定した Microsoft Windows ユーザー アカウントが、指定した Windows グループのメンバーであるかどうかを確認します。

名前空間:  Microsoft.SqlServer.Management.Smo
アセンブリ:  Microsoft.SqlServer.Smo (Microsoft.SqlServer.Smo.dll)

構文

'宣言
Public Function IsWindowsGroupMember ( _
    windowsGroup As String, _
    windowsUser As String _
) As Boolean
'使用
Dim instance As Server 
Dim windowsGroup As String 
Dim windowsUser As String 
Dim returnValue As Boolean 

returnValue = instance.IsWindowsGroupMember(windowsGroup, _
    windowsUser)
public bool IsWindowsGroupMember(
    string windowsGroup,
    string windowsUser
)
public:
bool IsWindowsGroupMember(
    String^ windowsGroup, 
    String^ windowsUser
)
member IsWindowsGroupMember : 
        windowsGroup:string * 
        windowsUser:string -> bool
public function IsWindowsGroupMember(
    windowsGroup : String, 
    windowsUser : String
) : boolean

パラメーター

  • windowsUser
    型: System.String
    Windows ユーザー アカウントを示す String 値です。

戻り値

型: System.Boolean
Windows ユーザー アカウントが Windows グループのメンバーであるかどうかを示す Boolean 値です。True の場合、Windows ユーザー アカウントは Windows グループのメンバーです。False の場合、Windows ユーザー アカウントは Windows グループのメンバーではありません。

使用例

Visual Basic

'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server
'Verify whether a Windows user is a member of a Windows group.
Console.WriteLine(srv.IsWindowsGroupMember( _
"BUILTIN\Administrators", "NT AUTHORITY\SYSTEM").ToString)

PowerShell

$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")

Write-Host $srv.IsWindowsGroupMember("BUILTIN\Administrators", "NT AUTHORITY\SYSTEM")

関連項目

参照

Server クラス

Microsoft.SqlServer.Management.Smo 名前空間

その他の技術情報

メソッドの呼び出し

サーバーの管理