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
<# | |
Allow an object to alter its behavior when its internal state changes. | |
The object will appear to change its class. | |
The State pattern puts each branch of the conditional in a separate class. | |
This lets you treat the object's state as an object in its own right | |
that can vary independently from other objects | |
#> |
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
# Intially copied from this article https://call4cloud.nl/2020/05/intune-auto-mdm-enrollment-for-devices-already-azure-ad-joined/ | |
# "The Improved One" | |
# Set MDM Enrollment URL's | |
$key = 'SYSTEM\CurrentControlSet\Control\CloudDomainJoin\TenantInfo\*' | |
try{ | |
$keyinfo = Get-Item "HKLM:\$key" | |
} | |
catch{ |
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
# Full credit for this goes to a SANS ICS diary by Rob Vandenbrink | |
# https://isc.sans.edu/diary/30532?n | |
Get-NetUDPEndpoint | | |
Select-Object LocalAddress,LocalPort,CreationTime,OwningProcess,@{Name="Process";Expression={(Get-Process -Id $_.OwningProcess).ProcessName}} | | |
Format-Table -auto |
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
# Full credit for this goes to a SANS ICS diary by Rob Vandenbrink | |
# https://isc.sans.edu/diary/30532?n | |
$now = get-date | |
Get-NetTCPConnection | | |
select-object LocalAddress,LocalPort,RemoteAddress,RemotePort,State,@{Name="LifetimeSec";Expression={($now-$_.CreationTime).seconds}},OwningProcess, @{Name="Process";Expression={(Get-Process -Id $_.OwningProcess).ProcessName}} | | |
sort-object -property LifetimeSec | | |
select-object -last 10 | | |
ft -auto |
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 | |
Lists delegated permissions (OAuth2PermissionGrants) and application permissions (AppRoleAssignments). | |
.PARAMETER DelegatedPermissions | |
If set, will return delegated permissions. If neither this switch nor the ApplicationPermissions switch is set, | |
both application and delegated permissions will be returned. | |
.PARAMETER ApplicationPermissions | |
If set, will return application permissions. If neither this switch nor the DelegatedPermissions switch is set, |
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
{ | |
"$schema" : "https://aka.ms/winget-packages.schema.2.0.json", | |
"CreationDate" : "2023-09-11T21:26:35.321-00:00", | |
"Sources" : | |
[ | |
{ | |
"Packages" : | |
[ | |
{ | |
"PackageIdentifier" : "Docker.DockerDesktop" |
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 -Version 6.0 | |
<# | |
.SYNOPSIS | |
Retrieves recent winget logs and searches them for a pattern, if specified. | |
.DESCRIPTION | |
This script parses the Windows Package Manager winget command-line tool log files and allows searching by specifying a pattern or date boundaries. | |
.PARAMETER Search | |
The pattern to search for in the log files. If not specified, all log entries are returned. | |
.PARAMETER AfterDate | |
The date after which to search for log entries. If not specified, all log entries are returned. |
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
# 1. Make sure the Microsoft App Installer is installed: | |
# https://www.microsoft.com/en-us/p/app-installer/9nblggh4nns1 | |
# 2. Edit the list of apps to install. | |
# 3. Run this script as administrator. | |
Write-Output "Installing Apps" | |
$apps = @( | |
@{name = "7zip.7zip" }, | |
@{name = "Docker.DockerDesktop"}, | |
@{name = "Dropbox.Dropbox" }, |
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
# Copyright: (c) 2020, Jordan Borean (@jborean93) <jborean93@gmail.com> | |
# MIT License (see LICENSE or https://opensource.org/licenses/MIT) | |
#Requires -Module MSAL.PS | |
Function New-EXOPSSession { | |
<# | |
.SYNOPSIS | |
Will open a PSSession to Exchange Online. |
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
net localgroup adminstrators | |
NewerOlder