This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$url = "." | |
new-spuser -UserAlias 'domain\userName' -web $url -SiteCollectionAdmin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$web = Get-SPWeb "http://portal" | |
function AddGroupToSite ($web, $groupName, $permLevel) | |
{ | |
$account = $web.SiteGroups[$groupName] | |
$assignment = New-Object Microsoft.SharePoint.SPRoleAssignment($account) | |
$role = $web.RoleDefinitions[$permLevel] | |
$assignment.RoleDefinitionBindings.Add($role); | |
$web.RoleAssignments.Add($assignment) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Permission enumeration : https://msdn.microsoft.com/en-us/library/office/ee556747(v=office.14).aspx | |
function checkPermissions() { | |
var call = jQuery.ajax({ | |
url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/effectiveBasePermissions", | |
type: "GET", | |
dataType: "json", | |
headers: { | |
Accept: "application/json;odata=verbose" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* http://sharepoint.stackexchange.com/questions/151473/how-to-truncate-a-multiline-column-in-a-sharepoint-list-2013 */ | |
<style> | |
.ms-vb2 .ms-rtestate-field{ | |
max-width:250px; | |
max-height:38px; | |
overflow:hidden; | |
} | |
.ms-vb2 .ms-rtestate-field:hover{ | |
max-height:none; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".ms-rtestate-write[id*='Steps']").click(function (){ | |
if ($(".ms-rtestate-write[id*='Steps'] ol").legth > 0) | |
{ | |
return; | |
} | |
else if ($(".ms-rtestate-write[id*='Steps'] p").length > 0) | |
{ | |
RTE.RichTextEditor.numberedList(); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
^(?i:(?=.*\bhospital\b)(?=.*\bmarketing\b)(?=.*\bguide\b)).+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Step 1. Make a copy of the spreadsheet in an empty directory. Rename the extension to .zip | |
Step 2. Extract the zip file. | |
Step 3. In the extracted contents, goto the folder \xl\worksheets\ | |
Step 4. There should be one xml file per sheet? I editing "sheet1.xml" with NotePad++. From nearly the very end of the file, remove the tag that starts with: | |
<sheetProtection | |
My entire tag was as follows: | |
<sheetProtection algorithmName="SHA-512" hashValue="ALciNBSIqRcjDiFbCuyWoGk4iOcC/ZRKnEjwEVi1skb6G5JbHhp+QVZ9+rlPVbGILOS7lYiCvJmR4Q7IuSphXA==" saltValue="8OVKXrG0VacLOLVztUpEYw==" spinCount="100000" sheet="1" objects="1" scenarios="1" selectLockedCells="1"/> | |
Step 5. Save the file. Open the ZIP file in 7zip, find the same file, drag and drop, save, exit, rename the file back to (xlsx) and open |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Open a connection to the SQL Server Database Engine | |
$sqlConnection = New-Object System.Data.SqlClient.SqlConnection | |
$sqlConnection.ConnectionString = "Server=SQLDB2016\SHAREPOINT;Database=master;Integrated Security=True" | |
$sqlConnection.Open() | |
# Query the master database | |
$sqlCommand = New-Object System.Data.SqlClient.SqlCommand | |
$sqlCommand.CommandText = "SELECT name FROM [master].[sys].[databases]" | |
$sqlCommand.Connection = $sqlConnection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
</style> | |
<div class="container-fluid" id="main"> | |
<div id="target"> | |
<span>Select the columns you would like returned: </span> <br> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkOutDocument(docId) | |
{ | |
jQuery.ajax({ | |
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('Resource Library')/items(" + docId + ")/file/CheckOut()", | |
type: "POST", | |
headers: { | |
"accept": "application/json;odata=verbose", | |
"X-RequestDigest": jQuery("#__REQUESTDIGEST").val(), | |
}, | |
success: function(){ |