OK So after moving the search index location when I tried to set the topology I got this cryptic error:
First try a Reboot!
If that doesn't work then try again - this
time with more available RAM - if command doesn't fail immediately then most
likely it's going to run:
This was basically a low resource error
Monday, 4 September 2017
Sunday, 9 April 2017
PowerShell remoting - create folder on remote servers
Preparation
Read-Host
-AsSecureString | ConvertFrom-SecureString | Out-File
C:\Scripts\<username>\<username>_pwd.txt
Variables
$SPserver =
"<servername>"
$username =
"\"
$password =
Get-Content C:\Scripts\<username>\<username>_pwd.txt | ConvertTo-SecureString
Credentials =
New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList
$username, $password
Connection
#Create remote
session to SP server
$session=New-PSSession
-ComputerName $SPserver -Credential $credentials
Create DIR
Invoke-Command
-Session $session -ArgumentList $output -ScriptBlock { mkdir E:\<FolderName> }
#Removing remote
sessions
Get-PSSession
|Remove-PSSession
Open a SharePoint list using PowerShell
Keep using this so put it up here for reference:
#Open SharePoint List
$SPServer="http://abcd01:9999/"
$SPAppList="/Lists/UPList/"
$spWeb = Get-SPWeb $SPServer
$spData = $spWeb.GetList($SPAppList)
$SPServer="http://abcd01:9999/"
$SPAppList="/Lists/UPList/"
$spWeb = Get-SPWeb $SPServer
$spData = $spWeb.GetList($SPAppList)
Export SharePoint Group members to .csv
Export SP Group members to .csv
# Script for extracting members of SP groups in a site to a .csv file
function global:Get-SPSite($url)
{
return new-Object
Microsoft.SharePoint.SPSite($url)
}
function global:Get-SPWeb($url)
{
$site= New-Object Microsoft.SharePoint.SPSite($url)
if($site -ne
$null)
{
$web=$site.OpenWeb();
}
return $web
}
$URL="https://extranet.domain/sites/Meetings"
$site =
Get-SPSite $URL
#Write the Header
to "Tab Separated Text File"
"Site
Name`t URL `t Group Name `t User Account
`t User Name `t E-Mail" | out-file
"c:\Scripts\UsersandGroupsRpt.txt"
#Iterate through
all Webs
foreach ($web in
$site.AllWebs)
{
#Write the
Header to "Tab Separated Text File"
"$($web.title) `t $($web.URL) `t
`t `t `t " | out-file
"c:\Scripts\UsersandGroupsRpt.txt" -append
#Get all
Groups and Iterate through
foreach
($group in $Web.groups)
{
"`t `t $($Group.Name)
`t `t `t " | out-file
"c:\Scripts\UsersandGroupsRpt.txt" -append
#Iterate through Each User in the group
foreach ($user in $group.users)
{
#Exclude Built-in User Accounts
if(($User.LoginName.ToLower() -ne "nt authority\authenticated
users") -and ($User.LoginName.ToLower() -ne "sharepoint\system")
-and ($User.LoginName.ToLower() -ne "nt authority\local service"))
{
"`t `t
`t $($user.LoginName) `t
$($user.name) `t
$($user.Email)" | out-file
"c:\Scripts\UsersandGroupsRpt.txt" -append
}
}
}
}
write-host
"Report Generated at c:\Scripts\UsersandGroupsRpt.txt"
Wednesday, 15 March 2017
Powershell script: bulk add users to SharePoint group
Note - You may need to check the Claims prefix
Here's the PowerShell:
Here's the PowerShell:
<# Instructions:
Create a Users.txt
in this format (all in one column):
i:0#.w|domain\aparnis
i:0#.w|domain\candlandan
i:0#.w|domain\stivj001
i:0#.w|domain\attaj001
i:0#.w|domain\marchorovitz
etc
Populate the
variables
#>
## Adding snap-in
Add-PSSnapin
"Microsoft.SharePoint.PowerShell"
# Variables
$group =
"External Readers"
$siteCollUrl =
"https://extranet.domain/groups/Board-of-Supervisors/"
$loc =
"C:\scripts"
$Users = Get-Content
"$loc\Users.txt"
$web = Get-SPWeb
-identity $siteCollUrl
# code
foreach ($User in
$Users) {
$web.EnsureUser($User)
Set-SPUser -Identity $User -Web
$siteCollUrl -Group $group
}
# Dispose the web
object
$Web.Dispose()
Tuesday, 14 February 2017
Translating SharePoint Audit log reports:
Translating Site ID and PrincipleID
I produced a
Audit report for Security events and though I can see that some security events
occurred on the relevant dates I couldn't find a way to translate the Site ID and
the Principle ID in the Site ID and Event Data columns.
It can be done! Enter PowerShell!!!!
Audit Log exported
to Excel and downloaded: It just looks horrible
Translate the siteID:
$site = get-spsite -limit all
$site | select ID, url | ft -AutoSize | out-file
C:\Scripts\siteID.txt
Then I did a find in the .txt file to match the site
ID with the URL
e.g.
Translate the PrincipleID:
$site = new-object
Microsoft.SharePoint.SPSite("http://SPWebApplication");
$ServiceContext =
[Microsoft.SharePoint.SPServiceContext]::GetContext($site);
$ProfileManager = new-object
Microsoft.Office.Server.UserProfiles.UserProfileManager($ServiceContext)
$AllProfiles = $ProfileManager.GetEnumerator()
$AllProfiles | select displayname,recordID | ft
-autosize | out-file c:\scripts\profiles.txt
Then do a Find on the Principle ID and you will get
the Display name mapping:
Translating groupid and userid
Pasted
from <http://sharepoint.stackexchange.com/questions/156443/who-is-behind-which-id-in-audit-logs>
E.G
I’ve
run a custom security report and the results show 5 permissions edits:
The
Event Data column shows the user affected in group\user format
To
find:
Etc
This shows you either the user's information or the
group's members depending on the entered id
So:
Note: The ids
are unique within site collections only. So ...?id=42 within site
collection A might be a different user or group in site
collection B.
That's all folks - Thanks for visiting!
Saturday, 11 February 2017
How to repair a degraded Search Component: Diagram
In this case the Index Component:
Link for SRx Core Tool:
https://gallery.technet.microsoft.com/office/srx-core-sharepoint-search-d60113e9
Link for SRx Core Tool:
https://gallery.technet.microsoft.com/office/srx-core-sharepoint-search-d60113e9
Manage Index:
Subscribe to:
Posts (Atom)
SharePoint Information Architecture Diagram
Here is the template I use for Information Architecture designs. It's built using Mindjet and I flesh the nodes out with the low level d...
-
Introduction This document is intended to highlight possible causes of poor indexing performance on SharePoint 2007 farms as well as p...
-
OPEN FIREWALL PORTS 56737 AND 56738 Submitted Request to Open firewall ports 56737 and 56738 in Approval Environment to enable Office Ser...
-
Translating Site ID and PrincipleID I produced a Audit report for Security events and though I can see that some security events occurre...






