This file contains 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
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | |
function Update-LastLogonTimestamp | |
{ | |
[CmdletBinding()] | |
param | |
( | |
[parameter(Position=0, Mandatory=$true)][string]$UserName | |
) |
This file contains 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
#requires -modules "PnP.PowerShell" | |
function Test-ListItemPath | |
{ | |
[CmdletBinding()] | |
param | |
( | |
[parameter(mandatory=$true)] | |
[string] |
This file contains 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
#requires -modules "PnP.PowerShell" | |
function Get-ItemAnalytics | |
{ | |
[CmdletBinding()] | |
param | |
( | |
[parameter(mandatory=$true)] | |
[string] | |
$ItemDriveUrl, |
This file contains 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 Test-CodeSign | |
{ | |
write-Host "HELLO WORLD" | |
} | |
<# | |
$params = @{ | |
Subject = "CN=PowerShell Script Code Signing" | |
Type = "CodeSigningCert" |
This file contains 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
Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking -ErrorAction Stop | |
# tenant name | |
$tenant = $env:O365_TENANT | |
# define a list of users or groups to report. Use UPN for user objects and ObjectId for group objects | |
$identities = "jane.doe@contoso.com", "john.doe@contoso.com", "986b904f-0de9-416d-9fd9-7e5d8402e7c0" | |
if( -not $credential ) | |
{ |
This file contains 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
#requires -modules "PnP.PowerShell" | |
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials | |
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 | |
function Invoke-FolderPermissionInheritanceReset | |
{ | |
[CmdletBinding()] | |
param | |
( |
This file contains 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
#requires -modules "PnP.PowerShell" | |
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials | |
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 | |
function Set-MajorVersionCount | |
{ | |
[CmdletBinding()] | |
param |
This file contains 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 New-Password | |
{ | |
[CmdletBinding()] | |
param | |
( | |
[Parameter(Mandatory=$true)] | |
[ValidateRange(2,128)] | |
[int] | |
$Length, |
This file contains 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 ConvertTo-Base64UrlEncodedString | |
{ | |
[CmdletBinding()] | |
param | |
( | |
[Parameter(Mandatory=$true)] | |
[byte[]] | |
$Bytes | |
) |