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
# Run with "powershell -ExecutionPolicy Bypass -File .\Get-EntraSubordinates-WithManagerOnly.ps1" | |
# Connect to Microsoft Graph | |
Connect-MgGraph -Scopes "User.Read.All", "Directory.Read.All" | |
# Function to recursively retrieve all subordinates under a manager | |
function Get-SubordinatesRecursive { | |
param ( | |
[string]$ManagerId, | |
[hashtable]$Visited, |
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
<# | |
Type : Detection | |
Job: Detects Microsoft 3D Viewer | |
Run as: System | |
Context: 64 Bit | |
#> | |
# Replace with part or full name of the app package | |
$appName = "Microsoft.Microsoft3DViewer" |
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
<# | |
Type: Detection | |
Job: Detects Registry Key and if present or not | |
Run as: System | |
Context: 64 Bit | |
#> | |
# Define Varibles | |
$regPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client" | |
$regName = "AllowBasic" |
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
# Sample Script for Win32 Application to set a reg key and monitor it. | |
$regPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client" | |
$valueName = "AllowBasic" | |
$desiredValue = 0 | |
# Ensure the registry key exists | |
if (-not (Test-Path $regPath)) { | |
New-Item -Path $regPath -Force | Out-Null | |
} |
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
# Install the Teams Module within PowerShell | |
Install-Module MicrosoftTeams | |
# Connect to Microsoft Teams PowerShell | |
Connect-MicrosoftTeams | |
#Get list of Users and export their details to csv | |
Get-CsOnlineUser -Filter {LineURI -ne $Null} | select DisplayName,LineURI,OnlineVoiceRoutingPolicy | Export-CSV c:\temp\teams.csv -NoTypeInformation |
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
# At the OOBE, open a command prompt session. Shift F10 | |
# Launch PowerShell | |
Powershell.exe | |
# Set PowerShell Execution Policy | |
Set-ExecutionPolicy bypass | |
# Install the AutoPilot Script | |
install-script get-windowsautopilotinfo |
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
Param ( | |
[string]$Computer = (Read-Host Remote computer name), | |
[int]$Days = 20 | |
) | |
cls | |
$Result = @() | |
Write-Host "Gathering Event Logs, this can take awhile..." | |
$ELogs = Get-EventLog System -Source Microsoft-Windows-WinLogon -After (Get-Date).AddDays(-$Days) -ComputerName $Computer | |
If ($ELogs) | |
{ Write-Host "Processing..." |
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
<?xml version="1.0" encoding="UTF-16"?> | |
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> | |
<RegistrationInfo> | |
<Date>2020-09-15T15:31:06.0051067</Date> | |
<Author>DOMAIN\user</Author> | |
<URI>\Restart Windows Search Service</URI> | |
</RegistrationInfo> | |
<Triggers> | |
<EventTrigger> | |
<Enabled>true</Enabled> |
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
$mailboxes = Get-Mailbox | |
foreach ($mailbox in $mailboxes) | |
{ | |
set-mailbox $mailbox.Alias -removedelayholdapplied | |
set-mailbox $mailbox.Alias -removedelayreleaseholdapplied | |
} | |
$mailboxes = Get-Mailbox | |
foreach ($mailbox in $mailboxes) |
NewerOlder