SPFarm.CurrentUserIsAdministrator method

Returns a Boolean value that indicates whether the current user is an administrator in the server farm.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Function CurrentUserIsAdministrator As Boolean
'Usage
Dim instance As SPFarm
Dim returnValue As Boolean

returnValue = instance.CurrentUserIsAdministrator()
public bool CurrentUserIsAdministrator()

Return value

Type: System.Boolean
true if the current user is a server farm administrator; otherwise, false.

Remarks

For security reasons, this will always return false in Web requests to Web applications other than the central administration site. To bypass this restriction, use the overload and set the allowContentApplicationAccess parameter to false.

See also

Reference

SPFarm class

SPFarm members

CurrentUserIsAdministrator overload

Microsoft.SharePoint.Administration namespace