$site = Get-SPSite "http://yoursite"
foreach ($web in $site.AllWebs) {
$web | Select-Object -Property Title,Url,WebTemplate
}
$site.Dispose()
foreach ($web in $site.AllWebs) {
$web | Select-Object -Property Title,Url,WebTemplate
}
$site.Dispose()
$site = Get-SPSite <Provide Site Collection URL here>
$web = $site.OpenWeb()
$groups = $web.sitegroups
foreach
($grp
in
$groups) {
"Group: "
+ $grp.name;
$groupName = $grp.name
write-host
"Group: "
$groupName -foregroundcolor green
foreach
($user
in
$grp.users) {
"User: "
+ $user.name
write-host
"User "
$user.UserLogin -foregroundcolor red
}
}
GetUsers.ps1
This will show output on screen.
GetUsers.ps1 | Out-File C:\Output.csv
This will generate output as csv file. "C:\Output.csv" is the file name and location where generated csv file is saved. Please change as per your requirement.
Setup.exe /q /ACTION=Install /FEATURES=SQL /INSTANCENAME=MSSQLSERVER /SQLSVCACCOUNT="<DomainName\UserName>" /SQLSVCPASSWORD="<StrongPassword>" /SQLSYSADMINACCOUNTS="<DomainName\UserName>" /AGTSVCACCOUNT="<DomainName\UserName>" /AGTSVCPASSWORD="<StrongPassword>" /IACCEPTSQLSERVERLICENSETERMS
Use-CacheClusterCheck if Cluster is 'UP'
Get-CacheHost
Start-CacheHost –ComputerName [yourServerName] –CachePort 22233then get your SharePoint farm GUID
$spFarm=[Microsoft.SharePoint.Administration.SPfarm]::LocalExport your current cluster configuration as backup. For reference and just in case..
$spFarm.Id
Export-CacheClusterConfig c:\Backup.xmlReplace text in XML bellow:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="dataCache" type="Microsoft.ApplicationServer.Caching.DataCacheSection, Microsoft.ApplicationServer.Caching.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</configSections>
<dataCache size="Medium">
<caches partitionCount="256">
<cache consistency="StrongConsistency" name="DistributedAccessCache_YOUR-FARM-ID"
minSecondaries="0">
<policy>
<eviction type="Lru" />
<expiration defaultTTL="10" isExpirable="true" />
</policy>
</cache>
<cache consistency="StrongConsistency" name="DistributedActivityFeedCache_YOUR-FARM-ID"
minSecondaries="0">
<policy>
<eviction type="Lru" />
<expiration defaultTTL="10" isExpirable="true" />
</policy>
</cache>
<cache consistency="StrongConsistency" name="DistributedActivityFeedLMTCache_YOUR-FARM-ID"
minSecondaries="0">
<policy>
<eviction type="None" />
<expiration defaultTTL="10" isExpirable="true" />
</policy>
</cache>
<cache consistency="StrongConsistency" name="DistributedBouncerCache_YOUR-FARM-ID"
minSecondaries="0">
<policy>
<eviction type="Lru" />
<expiration defaultTTL="10" isExpirable="true" />
</policy>
</cache>
<cache consistency="StrongConsistency" name="DistributedDefaultCache_YOUR-FARM-ID"
minSecondaries="0">
<policy>
<eviction type="Lru" />
<expiration defaultTTL="10" isExpirable="true" />
</policy>
</cache>
<cache consistency="StrongConsistency" name="DistributedLogonTokenCache_YOUR-FARM-ID"
minSecondaries="0">
<policy>
<eviction type="Lru" />
<expiration defaultTTL="10" isExpirable="true" />
</policy>
</cache>
<cache consistency="StrongConsistency" name="DistributedSearchCache_YOUR-FARM-ID"
minSecondaries="0">
<policy>
<eviction type="Lru" />
<expiration defaultTTL="10" isExpirable="true" />
</policy>
</cache>
<cache consistency="StrongConsistency" name="DistributedSecurityTrimmingCache_YOUR-FARM-ID"
minSecondaries="0">
<policy>
<eviction type="Lru" />
<expiration defaultTTL="10" isExpirable="true" />
</policy>
</cache>
<cache consistency="StrongConsistency" name="DistributedServerToAppServerAccessTokenCache_YOUR-FARM-ID"
minSecondaries="0">
<policy>
<eviction type="Lru" />
<expiration defaultTTL="10" isExpirable="true" />
</policy>
</cache>
<cache consistency="StrongConsistency" name="DistributedViewStateCache_YOUR-FARM-ID"
minSecondaries="0">
<policy>
<eviction type="Lru" />
<expiration defaultTTL="10" isExpirable="true" />
</policy>
</cache>
</caches>
<hosts>
<host replicationPort="22236" arbitrationPort="22235" clusterPort="22234"
hostId="280822625" size="1229" leadHost="true" account="CONTOSO\ClusterServiceAccount"
cacheHostName="AppFabricCachingService" name="SERVER1.COM"
cachePort="22233" />
</hosts>
<advancedProperties>
<partitionStoreConnectionSettings leadHostManagement="false" />
<securityProperties>
<authorization>
<allow users="WSS_ADMIN_WPG" />
<allow users="WSS_WPG" />
</authorization>
</securityProperties>
</advancedProperties>
<deploymentSettings>
<deploymentMode value="RoutingClient" />
</deploymentSettings>
</dataCache>
</configuration>
Stop-CacheClusterThen after several minutes try
Import-CacheClusterConfig C:\NewConfig.xml
Start-CacheCluster
Get-CacheYou should get:
CacheName [Host] Regions
———————–
default
DistributedAccessCache_
DistributedActivityFeedCache_
DistributedActivityFeedLMTCache_
.....