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 Invoke-SystemCommand { | |
<# | |
.SYNOPSIS | |
Execute a scriptblock as SYSTEM by setting up a temporary scheduled task. | |
.DESCRIPTION | |
Execute a scriptblock as SYSTEM by setting up a temporary scheduled task. | |
.PARAMETER Name | |
The name of the task |
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 Invoke-Dice { | |
[Alias('roll')] | |
[CmdletBinding()] | |
param ( | |
[int] | |
$Size = 20, | |
[int] | |
$Count = 1 | |
) |
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 Import-ADPrincipalSID { | |
<# | |
.SYNOPSIS | |
Copies the SID from a principal in one domain into the SID history of a principal in another. | |
.DESCRIPTION | |
Copies the SID from a principal in one domain into the SID history of a principal in another. | |
In order for this to work, some prerequisites must be met: |
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 Add-PrivateKeyRights { | |
<# | |
.SYNOPSIS | |
Adds rights to the private key of a certificate. | |
.DESCRIPTION | |
Adds rights to the private key of a certificate. | |
Useful for automating service account access to a system certificate. | |
.PARAMETER Thumbprint |
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 Get-ADgMSAKdsKey { | |
<# | |
.SYNOPSIS | |
Retrieves KDS Information for a gMSA. | |
.DESCRIPTION | |
Retrieves KDS Information for a group managed service account (gMSA). | |
It will attempt to verify the existence of the KDS Key, but depending on the rights involed, access might be denied. | |
.PARAMETER ServiceAccount |
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 main(workbook: ExcelScript.Workbook) { | |
// Get the active worksheet and used range. | |
let selectedSheet = workbook.getActiveWorksheet(); | |
let range = selectedSheet.getUsedRange(); | |
let texts = range.getTexts(); | |
let returnObjects: unknown[] = []; | |
returnObjects = returnObjectFromValues(texts) | |
console.log(JSON.stringify(returnObjects)); | |
} |
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 MiniGraph | |
<# | |
.SYNOPSIS | |
Clear all sharing permissions on a user's OneDrive | |
.DESCRIPTION | |
Before running this script, use any of the suitable Connect-* Commands in the MiniGraph module to connect. | |
Scopes needed for this script: | |
- User.Read.All : To retrieve the user data from graph |
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 Get-GpoBackupName { | |
[CmdletBinding()] | |
param ( | |
[Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] | |
[Alias('FullName')] | |
[string] | |
$Path | |
) | |
process { | |
foreach ($folder in $Path) { |
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
<# | |
.SYNOPSIS | |
Scans an Active Directory domain's and its principal's kerberos encryption configuration. | |
.DESCRIPTION | |
Scans an Active Directory domain's and its principal's kerberos encryption configuration. | |
It will generate all data via LDAP, and analyze the results for possible authentication issues. | |
It supports three ways to report: | |
- Print: Write analysis of results to screen |
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 Resolve-PathEx { | |
<# | |
.SYNOPSIS | |
Resolve a path. | |
.DESCRIPTION | |
Resolve a path. | |
Allows specifying success criteria, as well as selecting files or folders only. | |
.PARAMETER Path |
NewerOlder