Get-SPUser

指定された検索条件に一致するユーザー アカウント (複数可) を取得します。

構文

Get-SPUser
   [[-Identity] <SPUserPipeBind>]
   -Web <SPWebPipeBind>
   [-AssignmentCollection <SPAssignmentCollection>]
   [-Group <SPGroupPipeBind>]
   [-Limit <String>]
   [<CommonParameters>]

説明

Get-SPUser コマンドレットでは、Identity、Web、または Group パラメーターで指定された範囲に一致するすべての SharePoint ユーザー アカウントを取得します。

Identity パラメーターにユーザーのエイリアスを使用して完全一致を取得できます。

Windows PowerShell for SharePoint 製品のアクセス許可と最新情報については、「SharePoint Server コマンドレット」のオンライン ドキュメントをご覧ください。

------------------ 例 1 ------------------

Get-SPUser -Web 'https://sharepoint.contoso.com' -Group 'Viewers'

次の使用例は、サイト https://sharepoint.contoso.com上の SharePoint グループ閲覧者のすべてのメンバーを返します。

------------------ 例 2 ------------------

Get-SPUser -Identity 'i:0#.w|contoso\jdoe' -Web 'https://sharepoint.contoso.com'

次の使用例は、サイト https://sharepoint.contoso.comの Windows 要求を使用して識別された特定のユーザーを返します。

------------------ 例 3 ------------------

Get-SPUser -Identity 'contoso\jdoe' -Web 'https://sharepoint.contoso.com'

次の使用例は、サイトhttps://sharepoint.contoso.comのクラシック Windows 認証 を使用して識別された特定のユーザーを返します。

パラメーター

-AssignmentCollection

適切な破棄を行うためにオブジェクトを管理します。 SPWeb や SPSite などのオブジェクトの使用によって大量のメモリが使用される場合があるので、Windows PowerShell スクリプトでこれらのオブジェクトを使用するには適切なメモリ管理が必要です。 メモリの解放が必要になった場合は、SPAssignment オブジェクトを使用して、変数へのオブジェクトの割り当てとオブジェクトの破棄を行うことができます。 割り当てコレクションまたは Global パラメーターが使用されていない場合、SPWeb、SPSite、または SPSiteAdministration オブジェクトが使用されていると、オブジェクトは自動的に破棄されます。

Global パラメーターが使用されている場合は、オブジェクトはすべてグローバル ストアに格納されます。 Stop-SPAssignment コマンドを使用してオブジェクトの使用または破棄を直接行わないと、メモリ不足のシナリオになる場合があります。

Type:SPAssignmentCollection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-Group

新しいユーザーが属するユーザー グループを指定します。

Type:SPGroupPipeBind
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-Identity

返されるユーザーの ID またはログイン名を指定します。

種類は、従来の Windows 認証の "CONTOSO\jdoe" の形式や 'i:0#.w' など、有効な ID またはログイン名である必要があります|Contoso\jdoe' for Windows Claims。

Type:SPUserPipeBind
Aliases:UserAlias
Position:1
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-Limit

取得するユーザーの最大数を指定します。 既定値は 500 です。

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-Web

範囲として使用する Web サイトを指定します。

型は、12345678-90ab-cdef-1234-567890bcdefgh という形式の有効な GUID である必要があります。SharePoint Foundation Web サイトの有効な名前 (MySPSite1 など)。または有効な SPWeb オブジェクトのインスタンス。

Type:SPWebPipeBind
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019