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
#Remote Powershell into an affected AVD VM | |
Enter-PSSession -ComputerName "AVD-XX-YYY" | |
#Download PROCDUMP | |
#If the folder already exists, mkdir may fail | |
mkdir "C:\PROCDUMP" | |
chdir "C:\PROCDUMP" | |
Start-BitsTransfer "https://download.sysinternals.com/files/Procdump.zip" | |
Expand-Archive -Path "C:\PROCDUMP\Procdump.zip" -DestinationPath "C:\PROCDUMP" -Force | |
Remove-Item "C:\PROCDUMP\Procdump.zip" |
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
$imagePath = "D:\Temp\install.wim" | |
$driverPackagePath = "D:\Temp\Drivers" | |
$workingDirPath = "D:\Temp\WIMWORK" | |
########### | |
$imageFiles = Get-WindowsImage -ImagePath $imagePath | |
ForEach ($i in $imageFiles) { | |
Write-Output "Index $($i.ImageIndex) - $($i.ImageName)" |
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
######################################### | |
# Fix-CrowdStrikeBugViaSCVMM.ps1 | |
# Created by Ernie Costa | |
######################################### | |
# Original script written by Yusuf Ozturk and the VirtualMetric crew | |
# https://www.linkedin.com/pulse/crowdstrike-bug-fix-azure-stack-hci-yusuf-%25C3%25B6zt%25C3%25BCrk-elw0e | |
# | |
# Usage: | |
# Run at your own risk - make sure to scan thru EVERYTHING and ensure it will work for your environment. | |
# You obviously need SCVMM and a collection of hostnames. Put the hostnames as an array of strings and run! |
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
TITLE BreakOut | |
INCLUDE Irvine16.inc | |
.data | |
TitleStr BYTE " _ _ _ _ _ _ _ _ ",10,13, | |
" / \_/ \_/ \_/ \_/ \_/ \_/ \_/ \ ",10,13, | |
" ( B _ R _ E _ A _ K _ O _ U _ T )",10,13, | |
" \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ ",0 | |
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
$groupNames = @("Ernie-TestGroup001","Ernie-TestGroup002") | |
$ownerEmails = @("jane@contoso.com","bob@contoso.com","omar@contoso.com") | |
################################################################ | |
# Login | |
Connect-AzureAd | |
ForEach ($g in $groupNames) { |
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
$enterpriseAppNames = @("EnterpriseApp-ErnieTest010","EnterpriseApp-ErnieTest011") | |
$ownerEmails = @("bob@contoso.com","jane@contoso.com","omar@contoso.com") | |
########################################################################### | |
# Login | |
Connect-AzureAd | |
# Create each app, one at a time | |
ForEach ($e in $enterpriseAppNames) { |
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-WindowsFeature -Name EnhancedStorage | |
Import-Module -Name VMDirectStorage | |
Get-Command -Module VMDirectStorage | |
PS C:\> Get-Command -Module VMDirectStorage | |
CommandType Name Version Source | |
----------- ---- ------- ------ |
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
# https://learn.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps | |
# Change this to wherever you want the dumps to go | |
# I personally like a CSV if doing this on Hyper-V cluster; easier to gather logs in central place | |
$dumpFolderPath = "C:\ClusterStorage\VMLTRACE-01\FullDumps\$env:ComputerName" | |
# VMMS.exe | |
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" -Name "vmms.exe" -Force | |
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\vmms.exe" -Name "DumpFolder" -PropertyType String -Value $dumpFolderPath | |
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\vmms.exe" -Name "DumpCount" -PropertyType DWORD -Value 4 |
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
Add-Type @' | |
using System; | |
using System.Runtime.InteropServices; | |
using System.Drawing; | |
public class DPI { | |
[DllImport("gdi32.dll")] | |
static extern int GetDeviceCaps(IntPtr hdc, int nIndex); | |
public enum DeviceCap { |
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
For ($i=1; $i -le 100; $i++) { | |
$responseString = "" | |
If ( !($i % 3) ) { $responseString += "Fizz" } | |
If ( !($i % 5) ) { $responseString += "Buzz" } | |
If ( ($i % 3) -and ($i % 5) ) { $responseString += $i } | |
Write-Output $responseString | |
} |
NewerOlder