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 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 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 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 |
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 Get-GpoBackupName { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] | |
| [Alias('FullName')] | |
| [string] | |
| $Path | |
| ) | |
| process { | |
| foreach ($folder in $Path) { |
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 ConvertTo-TrustObject { | |
| <# | |
| .SYNOPSIS | |
| Converts an AD Object for a trust object and parses it into humanly useful information. | |
| .DESCRIPTION | |
| Converts an AD Object for a trust object and parses it into humanly useful information. | |
| This includes encryption settings and parsing the numeric values of the trust attributes. | |
| .PARAMETER Trust |
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 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 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
| <# | |
| .SYNOPSIS | |
| A script to transfer modules from one repository to another while codesigning them. | |
| .DESCRIPTION | |
| Script intended for use in a code-signing pipeline: | |
| It will scan source and destination repository and for each missing (or lower version) module will: | |
| - Download the module from the source repository | |
| - Sign all code from that module with the specified certificate retrieved from certificate store. | |
| - Publish the module to the destination store |
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
| <# | |
| .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 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 Get-LdapObject { | |
| <# | |
| .SYNOPSIS | |
| Use LDAP to search in Active Directory | |
| .DESCRIPTION | |
| Utilizes LDAP to perform swift and efficient LDAP Queries. | |
| .PARAMETER LdapFilter |
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 Get-ServiceAccess { | |
| <# | |
| .SYNOPSIS | |
| Returns windows service security information from registry | |
| .DESCRIPTION | |
| Returns windows service security information from registry. | |
| This allows finding services that have been hidden from SCM through a deny rule. | |
| Triggered by this thread on Twitter: |
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 Connect-ClientSecret { | |
| <# | |
| .SYNOPSIS | |
| Connects to AzureAD using a client secret. | |
| .DESCRIPTION | |
| Connects to AzureAD using a client secret. | |
| .PARAMETER ClientID | |
| The ID of the registered app used with this authentication request. |