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 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
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
#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 Resolve-PathEx { | |
<# | |
.SYNOPSIS | |
Resolve a path. | |
.DESCRIPTION | |
Resolve a path. | |
Allows specifying success criteria, as well as selecting files or folders only. | |
.PARAMETER 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
$Name = 'cmd' | |
$ArgumentList = @( | |
) | |
#region Functions | |
function Start-RedirectedProcess { | |
[OutputType([System.Diagnostics.Process])] | |
[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 Read-Hashtable { | |
<# | |
.Synopsis | |
Reads a hash table and returns its contents as key/value objects. | |
.DESCRIPTION | |
Reads a hash table and returns its contents as a hierarchical structure. | |
Use the AsHashtable switch to return the result as a flat hashtable, rather than one object per. | |
.PARAMETER Hashtable |
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 Disable-Privilege { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory = $true)] | |
[ValidateSet('SeAssignPrimaryTokenPrivilege','SeAuditPrivilege','SeBackupPrivilege','SeChangeNotifyPrivilege','SeCreateGlobalPrivilege','SeCreatePagefilePrivilege','SeCreatePermanentPrivilege','SeCreateSymbolicLinkPrivilege','SeCreateTokenPrivilege','SeDebugPrivilege','SeDelegateSessionUserImpersonatePrivilege','SeEnableDelegationPrivilege','SeImpersonatePrivilege','SeIncreaseBasePriorityPrivilege','SeIncreaseQuotaPrivilege','SeIncreaseWorkingSetPrivilege','SeLoadDriverPrivilege','SeLockMemoryPrivilege','SeMachineAccountPrivilege','SeManageVolumePrivilege','SeProfileSingleProcessPrivilege','SeRelabelPrivilege','SeRemoteShutdownPrivilege','SeRestorePrivilege','SeSecurityPrivilege','SeShutdownPrivilege','SeSyncAgentPrivilege','SeSystemEnvironmentPrivilege','SeSystemProfilePrivilege','SeSystemtimePrivilege','SeTakeOwnershipPrivilege','SeTcbPrivilege','SeTimeZonePrivilege','SeTrustedCredManAccessPrivilege','SeUndockPrivi |
NewerOlder