Intune – Forcing PowerShell – Device Sync

This is how you would force an Intune sync for ALL devices.   Code.ps1   # MrNetTek # eddiejackson.net # 7/10/2024 # free for public use # free to claim as your own Install-Module -Name Microsoft.Graph.Intune -Force -AllowClobber Install-Module -Name Microsoft.Graph.DeviceManagement.Actions -Force -AllowClobber Install-Module -Name Microsoft.Graph.DeviceManagement -Force -AllowClobber # Connect to Graph Connect-MgGraph -scope DeviceManagementManagedDevices.PrivilegedOperations.All, Read More …

PowerShell – Uninstall Silverlight (or other Apps)

  Code.ps1   # MrNetTek # eddiejackson.net # 7/15/2022 # free for public use # free to claim as your own $SoftwareName = “Silverlight” $ItemProperties = Get-ItemProperty “HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*” | Select-Object DisplayName,UninstallString foreach ($Item in $ItemProperties) { $DisplayName = $Item.DisplayName $UninstallString = $Item.UninstallString if($DisplayName -like “*$SoftwareName*”) { Write-Host “$DisplayName : $UninstallString” # Output: Microsoft Silverlight : Read More …

Azure – VDI – Nerdio – Add AD Group to Host Session

  Code.ps1   # MrNetTek # eddiejackson.net # 7/15/2022 # free for public use # free to claim as your own $ErrorActionPreference = ‘Continue’ Write-output “Getting Host Pool Information” $HostPool = Get-AzResource -ResourceId $HostpoolID $HostPoolResourceGroupName = $HostPool.ResourceGroupName $HostPoolName = $Hostpool.Name $Script = @” `$ErrorActionPreference = ‘Continue’ Try { #Add specific user #Add-LocalGroupMember -Group “Administrators” -Member Read More …

PowerShell – Set DPI Aware

  Code.ps1   # MrNetTek # eddiejackson.net # 7/15/2022 # free for public use # free to claim as your own # Add a new type definition using C# code Add-Type -TypeDefinition @’ using System.Runtime.InteropServices; // Import the necessary namespace for DLL import public class ProcessDPI { // Declare an external method from user32.dll to Read More …

PowerShell – Detect Autoscaling

  Code.ps1   # MrNetTek # eddiejackson.net # 7/15/2022 # free for public use # free to claim as your own #DETECT CURRENT AUTOSCALING function Get-DisplayPrimaryScaling { [CmdletBinding()] param () #Add-Type -Assembly System.Drawing # Get DPI Scaling #[void] [System.Reflection.Assembly]::LoadWithPartialName(“System.Drawing”) Add-Type @’ using System; using System.Runtime.InteropServices; using System.Drawing; public class DPI { [DllImport(“gdi32.dll”)] static extern int Read More …

PowerShell – Adding Tabs to a Form

  Code.ps1   # MrNetTek # eddiejackson.net # 7/15/2022 # free for public use # free to claim as your own [void] [System.Reflection.Assembly]::LoadWithPartialName(“System.Windows.Forms”) [void] [System.Reflection.Assembly]::LoadWithPartialName(“System.Drawing”) [void] [System.Reflection.Assembly]::LoadWithPartialName(“PresentationFramework”) [void] [Reflection.Assembly]::LoadWithPartialName(“PresentationCore”) $Form = New-Object System.Windows.Forms.Form $Form.Text = “Test Form” $Form.Size = New-Object System.Drawing.Size(630,840) $Form.StartPosition = “CenterScreen” $Form.ShowInTaskbar = $True $Form.KeyPreview = $True $Form.AutoSize = $True $Form.FormBorderStyle = Read More …