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
[CmdletBinding(DefaultParameterSetName = 'Default')] | |
param ( | |
[Parameter(ParameterSetName = 'ByServicePrincipalId')] | |
[ValidateNotNullOrEmpty()] | |
[string] | |
$ServicePrincipalId, | |
[Parameter(ParameterSetName = 'ByDisplayName')] | |
[ValidateNotNullOrEmpty()] | |
[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
# Get-ServiceDependecyStatus.ps1 | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory)] | |
[System.Object[]] | |
$ServiceList | |
) | |
foreach ($currentService in $ServiceList) { | |
try { |
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
## ORIGINALLY FROM - https://theitbros.com/how-to-get-list-of-installed-programs-in-windows-10 | |
# Get-InstalledApps.ps1 | |
[CmdletBinding()] | |
param ( | |
[parameter()] | |
[switch]$Credential, | |
[parameter(ValueFromPipeline = $true)] | |
[String[]]$ComputerName = $env:COMPUTERNAME | |
) |
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
# Get-BitLockerRecoveryPassword.ps1 | |
[CmdletBinding(DefaultParameterSetName = 'byComputerName')] | |
param ( | |
[Parameter(Mandatory, ParameterSetName = 'byComputerName')] | |
[string] | |
$ComputerName, | |
[Parameter(Mandatory, ParameterSetName = 'byKeyId')] | |
[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
# Get-ADUserLastLogOnTime.ps1 | |
[CmdletBinding()] | |
param ( | |
[Parameter()] | |
[String] | |
$LogonName | |
) | |
Import-Module ActiveDirectory |
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
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory)] [string[]] $SiteURL, | |
[parameter(Mandatory)] [int]$VersioningLimit, | |
[parameter(Mandatory)] [string]$ApplicationId, | |
[parameter(Mandatory)] [string]$Thumbprint, | |
[parameter(Mandatory)] [string]$Tenant, | |
[parameter()] [bool] $TestMode = $true | |
) |
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
#Get_SPO_External_Users_All.ps1 | |
# Get SharePoint Online Sites | |
$site = Get-SPOSite -Limit All | |
# Initialize the results placeholder arraylist | |
$externalUsers = [System.Collections.ArrayList]@() | |
for ($i = 0; $i -lt ($site.Count); $i++) { | |
# Set the initial position index to 0 (zero-based index). |
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
#Get_SPO_External_Users.ps1 | |
# Specify the SharePoint Online site URL. | |
$siteUrl = 'https://lazyexch.sharepoint.com/sites/CustomerSupportPortal' | |
# Initialize the results placeholder arraylist | |
$externalUsers = [System.Collections.ArrayList]@() | |
# Set the initial position index to 0 (zero-based index). | |
$positionIndex = 0 |
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
# Export-DLMembers.ps1 | |
[CmdletBinding()] | |
param ( | |
[Parameter()] | |
$DistributionList | |
) | |
if ($DistributionList) { | |
try { | |
$group = Get-DistributionGroup -Identity $DistributionList -ErrorAction Stop |
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 to get the Sessions | |
Function Get-LoggedOnSessions { | |
param( | |
$Server = "localhost" | |
) | |
query session /server:$Server | | |
ForEach-Object { | |
$_.Trim() -replace '\s{2,}',',' | |
} | ConvertFrom-Csv | |
} |
NewerOlder