Wednesday, 24 February 2016

OneLiners in PowerShell with SharePoint for User

#View Users for Web Application/Site collection
#To view sample sites Get-SpWeb -Site "http://intranet.contoso.com/sites/contoso/"
Get-SPUser -Web "http://intranet.contoso.com/sites/contoso/blog2"
#View count of Users
Get-SPUser -Web "http://intranet.contoso.com/sites/contoso/blog2" |measure
#View SiteAdmins
Get-SPUser -Web "http://intranet.contoso.com/sites/contoso/blog2"|?{$_.IsSiteAdmin -eq $true}
#View Site Auditor
Get-SPUser -Web "http://intranet.contoso.com/sites/contoso/blog2"|?{$_.IsSiteAuditor -eq $true}
#View Users starting with j
Get-SPUser -Web "http://intranet.contoso.com/sites/contoso/blog2"|?{$_.DisplayName -like "j*"}
#View App Account
Get-SPUser -Web "http://intranet.contoso.com/sites/contoso/blog2"|?{$_.DisplayName -like "*app*"}
#View DisplayNames of all Users
(Get-SPUser -Web "http://intranet.contoso.com/sites/contoso/blog2").DisplayName
#View Emails
(Get-SPUser -Web "http://intranet.contoso.com/sites/contoso/blog2").Email
#View Groups
(Get-SPUser -Web "http://intranet.contoso.com/sites/contoso/blog2").Groups.Name
#View User IDs
(Get-SPUser -Web "http://intranet.contoso.com/sites/contoso/blog2").UserID
#ViewUSer Login
(Get-SPUser -Web "http://intranet.contoso.com/sites/contoso/blog2").UserLogin
Get-SPUserLicense
#View all claim-to-user license mappings
Get-SPUserLicenseMapping -WebApplication "http://w15-sp"
Get-SPUserLicenseMapping
#To add New-SPUserLicenseMapping -SecurityGroup "Viewers" -License Enterprise | Add-SPUserLicenseMapping
#Check if UserLicensing is Enabled
Get-SPUserLicensing
#User PRofile Settings
Get-SPUserSettingsProvider
#ID  of User PRofile Settings
(Get-SPUserSettingsProvider).ProviderIdentifier
#User PRofile Settings Manager
Get-SPUserSettingsProviderManager
# DisplayName of User PRofile Settings Manager
(Get-SPUserSettingsProviderManager).DisplayName
#Id of User PRofile Settings Manager
(Get-SPUserSettingsProviderManager).Id
#Version of User PRofile Settings Manager
(Get-SPUserSettingsProviderManager).Version
#Status of User PRofile Settings Manager
(Get-SPUserSettingsProviderManager).Status
#TypeName of User PRofile Settings Manager
(Get-SPUserSettingsProviderManager).TypeName

No comments:

Post a Comment