├── APPXPACKAGEREMOVAL ├── APPXPACKAGEREMOVAL.ps1 └── README.md ├── ActivateEmbeddedProductKey ├── ActivateEmbeddedProductKey.ps1 ├── LicenseDetect.ps1 └── README.md ├── Automaticall update Windows Defender Antimalware ├── README.md └── WindowsDefenderUpdateV1.0.ps1 ├── Automatically Update Microsoft Edge ├── EdgeUpdateAutopilot.ps1 └── README.md ├── Configure Time Zone ├── READMe.md └── SetTimeZone.ps1 ├── DriveMappings ├── DriveMappingsv1.0_CreateScheduledTask.ps1 ├── DriveMappingsv1.0_ScriptRunFromTaskScheduler.ps1 ├── DriveMappingsv1.0_ScriptRunFromTaskScheduler.vbs └── READMe.md ├── Install-LanguageExperiencePack_Windows11nl-NL ├── Install-LanguageExperiencePack_Windows11nl-NL.ps1 └── README.md ├── InstallLanguagePackDuringAutopilotESP_Windows11nl-NL ├── InstallLanguagePackDuringAutopilotESP_Windows11nl-NL.ps1 └── README.md ├── PrinterMapping ├── Printermappingv1.0_CreateScheduledTask.ps1 ├── Printermappingv1.0_ScriptRunFromTaskScheduler.ps1 ├── Printermappingv1.0_ScriptRunFromTaskScheduler.vbs └── README.md ├── README.md ├── Remove new Outlook client ├── NewOutlookClient_Detection.ps1 ├── NewOutlookClient_Remediation.ps1 └── README.md ├── Uninstall Dev Home app ├── README.md ├── UninstallDevHome_Detection.ps1 └── UninstallDevHome_Remediation.ps1 └── modify Edge Link ├── README.md └── modify Edge Link.ps1 /APPXPACKAGEREMOVAL/APPXPACKAGEREMOVAL.ps1: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------------------------------------ # 2 | # Author(s) : Peter Klapwijk - www.InTheCloud247.com # 3 | # Version : 1.0 # 4 | # # 5 | # Description : This script removes unwanted (pre-installed) AppX packages from the system # 6 | # # 7 | # Changes : v1.0 - Initial version # 8 | # # 9 | # This script is provide "As-Is" without any warranties # 10 | #------------------------------------------------------------------------------------------------------------- # 11 | 12 | 13 | If ($ENV:PROCESSOR_ARCHITEW6432 -eq "AMD64") { 14 | Try { 15 | &"$ENV:WINDIR\SysNative\WindowsPowershell\v1.0\PowerShell.exe" -File $PSCOMMANDPATH 16 | } 17 | Catch { 18 | Throw "Failed to start $PSCOMMANDPATH" 19 | } 20 | Exit 21 | } 22 | 23 | Function CleanUpAndExit() { 24 | Param( 25 | [Parameter(Mandatory=$True)][String]$ErrorLevel 26 | ) 27 | 28 | 29 | # Write results to registry for Intune Detection 30 | $Key = "HKEY_LOCAL_MACHINE\Software\$StoreResults" 31 | $NOW = Get-Date -Format "yyyyMMdd-hhmmss" 32 | 33 | If ($ErrorLevel -eq "0") { 34 | [microsoft.win32.registry]::SetValue($Key, "Success", $NOW) 35 | } else { 36 | [microsoft.win32.registry]::SetValue($Key, "Failure", $NOW) 37 | [microsoft.win32.registry]::SetValue($Key, "Error Code", $ErrorLevel) 38 | } 39 | 40 | # Exit Script with the specified ErrorLevel 41 | Stop-Transcript | Out-Null 42 | EXIT $ErrorLevel 43 | } 44 | 45 | # ---------------------------------------------------------------------------- # 46 | # Set Generic Script Variables, etc. 47 | # ---------------------------------------------------------------------------- # 48 | $StoreResults = "Klapwijk\AppXRemoval\v1.0" 49 | 50 | # Ensure the log directory exists 51 | $LogDirectory = "$env:ProgramData\Microsoft\IntuneManagementExtension\Logs" 52 | If (-Not (Test-Path -Path $LogDirectory)) { 53 | New-Item -ItemType Directory -Path $LogDirectory -Force | Out-Null 54 | } 55 | 56 | # Start Transcript 57 | If (-not $PSCOMMANDPATH) { 58 | Throw "PSCOMMANDPATH is not defined." 59 | } 60 | 61 | Try { 62 | Start-Transcript -Path "$LogDirectory\$($(Split-Path $PSCommandPath -Leaf).ToLower().Replace('.ps1','.log'))" | Out-Null 63 | } Catch { 64 | Write-Output "Warning: Failed to start transcript. Error: $_" 65 | } 66 | 67 | # List of AppX packages to remove 68 | $AppXPackagesToRemove = @( 69 | "Microsoft.BingNews", 70 | "Microsoft.BingWeather", 71 | "Microsoft.GamingApp", 72 | "Microsoft.GetHelp", 73 | "Microsoft.Getstarted", 74 | "Microsoft.Microsoft3DViewer", 75 | "Microsoft.MicrosoftOffaiceHub", 76 | "Microsoft.MicrosoftSolitaireCollection", 77 | "Microsoft.MixedReality.Portal", 78 | "Microsoft.Office.OneNote", 79 | "Microsoft.People", 80 | "Microsoft.PowerAutomateDesktop", 81 | "Microsoft.SkypeApp", 82 | "Microsoft.Xbox.TCUI", 83 | "Microsoft.XboxGameOverlay", 84 | "Microsoft.XboxGamingOverlay", 85 | "Microsoft.XboxIdentityProvider", 86 | "Microsoft.XboxSpeechToTextOverlay", 87 | "Microsoft.WindowsAlarms", 88 | "Microsoft.windowscommunicationsapps", 89 | "Microsoft.WindowsFeedbackHub", 90 | "Microsoft.WindowsMaps", 91 | "Microsoft.WindowsSoundRecorder", 92 | "Microsoft.YourPhone", 93 | "Microsoft.ZuneMusic", 94 | "Microsoft.ZuneVideo", 95 | "Microsoft.OutlookForWindows", 96 | "Microsoft.Copilot", 97 | "Microsoft.Windows.DevHome", 98 | "Microsoft.MicrosoftStickyNotes" 99 | ) 100 | 101 | # Function to remove AppX packages for the current user or all users 102 | function Remove-AppXPackages { 103 | param ( 104 | [string[]]$Packages, 105 | [switch]$ForAllUsers 106 | ) 107 | 108 | foreach ($PackageName in $Packages) { 109 | if ($ForAllUsers) { 110 | Write-Output "Removing AppX package '$PackageName' for all users..." 111 | Get-AppxPackage -AllUsers -Name $PackageName | ForEach-Object { 112 | try { 113 | Remove-AppxPackage -Package $_.PackageFullName -AllUsers -ErrorAction Stop 114 | Write-Output "Removed package: $($_.Name)" 115 | } catch { 116 | Write-Output "Failed to remove package: $($_.Name). Error: $_" 117 | } 118 | } 119 | } else { 120 | Write-Output "Removing AppX package '$PackageName' for the current user..." 121 | Get-AppxPackage -Name $PackageName | ForEach-Object { 122 | try { 123 | Remove-AppxPackage -Package $_.PackageFullName -ErrorAction Stop 124 | Write-Output "Removed package: $($_.Name)" 125 | } catch { 126 | Write-Output "Failed to remove package: $($_.Name). Error: $_" 127 | } 128 | } 129 | } 130 | } 131 | } 132 | 133 | # Function to remove AppxProvisionedPackages 134 | function Remove-AppxProvisionedPackages { 135 | param ( 136 | [string[]]$Packages 137 | ) 138 | 139 | foreach ($PackageName in $Packages) { 140 | Write-Output "Removing provisioned AppX package '$PackageName'..." 141 | Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName -eq $PackageName } | ForEach-Object { 142 | try { 143 | Remove-AppxProvisionedPackage -Online -PackageName $_.PackageName -ErrorAction Stop 144 | Write-Output "Removed provisioned package: $($_.DisplayName)" 145 | } catch { 146 | Write-Output "Failed to remove provisioned package: $($_.DisplayName). Error: $_" 147 | } 148 | } 149 | } 150 | } 151 | 152 | # Clear previous errors 153 | $Error.Clear() 154 | 155 | # Comment the line which is not needed 156 | # Remove the specified AppX packages for the current user 157 | Write-Output "Start removing AppX packages for the current user" 158 | Remove-AppXPackages -Packages $AppXPackagesToRemove 159 | 160 | # Remove the specified AppX packages for all users 161 | Write-Output "Start removing AppX packages for the all users" 162 | Remove-AppXPackages -Packages $AppXPackagesToRemove -ForAllUsers 163 | 164 | # Remove the specified provisioned AppX packages 165 | Write-Output "Start removing provisioned AppX packages" 166 | Remove-AppxProvisionedPackages -Packages $AppXPackagesToRemove 167 | 168 | # Result 169 | If ($Error.Count -gt 0) { 170 | Write-Output "Removing AppX Packages failed: $($Error[0])" 171 | CleanUpAndExit -ErrorLevel 101 172 | } else { 173 | Write-Output "Successfully Removed AppX packages" 174 | } 175 | 176 | CleanUpAndExit -ErrorLevel 0 177 | -------------------------------------------------------------------------------- /APPXPACKAGEREMOVAL/README.md: -------------------------------------------------------------------------------- 1 | ![This is an image](https://www.inthecloud247.com/wp-content/uploads/2022/06/GitHub-PowerShell.png) 2 | 3 | Script APPXPACKAGEREMOVAL.ps1 will remove AppX packages from the system that are listed in the app array. 4 | -------------------------------------------------------------------------------- /ActivateEmbeddedProductKey/ActivateEmbeddedProductKey.ps1: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------------------------------- # 2 | # Author(s) : Peter Klapwijk - www.InTheCloud247.com # 3 | # Version : 1.0 # 4 | # # 5 | # Description : Script retrieves the firmware-embedded product key and activates Windows # 6 | # with this key # 7 | # # 8 | # Changes : v1.0 Initial version # 9 | # # 10 | # --------------------------------------------------------------------------------------------- # 11 | 12 | # Start Transcript 13 | $Transcript = "C:\programdata\Microsoft\IntuneManagementExtension\Logs\$($(Split-Path $PSCommandPath -Leaf).ToLower().Replace(".ps1",".log"))" 14 | Start-Transcript -Path $Transcript | Out-Null 15 | 16 | #Get firmware-embedded product key 17 | try { 18 | $EmbeddedKey=(Get-CimInstance -query 'select * from SoftwareLicensingService').OA3xOriginalProductKey 19 | write-host "Firmware-embedded product key is "$EmbeddedKey"" 20 | } catch { 21 | write-host "ERROR: Failed to retrieve firmware-embedded product key" 22 | Exit 1 23 | } 24 | 25 | #Install embedded key 26 | try { 27 | cscript.exe "$env:SystemRoot\System32\slmgr.vbs" /ipk "$EmbeddedKey" 28 | write-host "Installed license key" 29 | } catch { 30 | write-host "ERROR: Changing license key failed" 31 | Exit 2 32 | } 33 | 34 | #Active embedded key 35 | try { 36 | cscript.exe "$env:SystemRoot\System32\slmgr.vbs" /ato 37 | write-host "Windows activated" 38 | } catch { 39 | write-host "ERROR: Windows could not be activated." 40 | Exit 3 41 | } 42 | 43 | #Check Product Key Channel 44 | $getreg=Get-WmiObject SoftwareLicensingProduct -Filter "ApplicationID = '55c92734-d682-4d71-983e-d6ec3f16059f' and LicenseStatus = '1'" 45 | $ProductKeyChannel=$getreg.ProductKeyChannel 46 | 47 | if ($getreg.ProductKeyChannel -eq "OEM:DM") { 48 | write-host "Windows activated, ProductKeyChannel = "$ProductKeyChannel"" 49 | Exit 0 50 | } else { 51 | write-host "ERROR: Windows could not be activated. "$ProductKeyChannel"" 52 | Exit 4 53 | } 54 | 55 | Stop-Transcript 56 | -------------------------------------------------------------------------------- /ActivateEmbeddedProductKey/LicenseDetect.ps1: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------------------------------- # 2 | # Author(s) : Peter Klapwijk - www.InTheCloud247.com # 3 | # Version : 1.0 # 4 | # # 5 | # Description : Detection script to be used with Microsoft Intune, determines if the current # 6 | # Product Key Channel is OEM or Retail # 7 | # # 8 | # Changes : v1.0 Initial version # 9 | # # 10 | # --------------------------------------------------------------------------------------------- # 11 | 12 | $getreg=Get-WmiObject SoftwareLicensingProduct -Filter "ApplicationID = '55c92734-d682-4d71-983e-d6ec3f16059f' and LicenseStatus = '1'" 13 | $ProductKeyChannel=$getreg.ProductKeyChannel 14 | 15 | if ($getreg.ProductKeyChannel -eq "OEM:DM" -or $getreg.ProductKeyChannel -eq "Retail") { 16 | write-host "Correct ProductKeyChannel found = "$ProductKeyChannel"" 17 | Exit 0 18 | } else { 19 | write-host "ERROR: Wrong ProductKeyChannel found = "$ProductKeyChannel"" 20 | Exit 4 21 | } 22 | -------------------------------------------------------------------------------- /ActivateEmbeddedProductKey/README.md: -------------------------------------------------------------------------------- 1 | ![This is an image](https://www.inthecloud247.com/wp-content/uploads/2022/06/GitHub-PowerShell.png) 2 | 3 | Script ActivateEmbeddedProductKey.ps1 retrieves the firmware-embedded product key and activates Windows with this key. 4 | Can also be used in Microsoft Intune when wrapped as win32 app, LicenseDetect.ps1 can be used as detection script for the win32 app. 5 | 6 | 7 | Related blog post can be found [Here](https://www.inthecloud247.com/activate-windows-with-the-firmware-embedded-product-key/) 8 | -------------------------------------------------------------------------------- /Automaticall update Windows Defender Antimalware/README.md: -------------------------------------------------------------------------------- 1 | ![This is an image](https://www.inthecloud247.com/wp-content/uploads/2022/06/GitHub-PowerShell.png) 2 | 3 | This is an example of how we can automatically update Windows Defender Antimalware (for example during Autopilot enrollment). 4 | 5 | An option to deploy the scripts is to wrap them as a win32 app and deploy the package with Microsoft Intune (during Autopilot enrollment). 6 | 7 | The logs are saved on %programdata%\Microsoft\IntuneManagementExtension\Logs. This makes it available in the Device Diagnostics for Intune. 8 | 9 | The related blog post can be found here [Here](https://inthecloud247.com/) 10 | -------------------------------------------------------------------------------- /Automaticall update Windows Defender Antimalware/WindowsDefenderUpdateV1.0.ps1: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------------------------------------ # 2 | # Author(s) : Peter Klapwijk - www.InTheCloud247.com # 3 | # Version : 1.0 # 4 | # # 5 | # Description : Enforce a first initial Windows Defender update # 6 | # # 7 | # After a successful Windows Autopilot deployment the Antimalware version is outdated or # 8 | # sometimes Windows Defender real-time protection is turned off. To fix this a Defender # 9 | # update is required. This script performs an Windows Defender update. # 10 | # # 11 | # Changes : v1.0 20250401 - Initial version (Peter Klapwijk) # 12 | # # 13 | #------------------------------------------------------------------------------------------------------------- # 14 | 15 | # Microsoft Intune Management Extension might start a 32-bit PowerShell instance. If so, restart as 64-bit PowerShell 16 | If ($ENV:PROCESSOR_ARCHITEW6432 -eq "AMD64") { 17 | Try { 18 | &"$ENV:WINDIR\SysNative\WindowsPowershell\v1.0\PowerShell.exe" -File $PSCOMMANDPATH 19 | } 20 | Catch { 21 | Throw "Failed to start $PSCOMMANDPATH" 22 | } 23 | Exit 24 | } 25 | 26 | 27 | #region Functions 28 | Function CleanUpAndExit() { 29 | Param( 30 | [Parameter(Mandatory=$True)][String]$ErrorLevel 31 | ) 32 | 33 | # Write results to registry for Intune Detection (change company name to your needs) 34 | $Key = "HKEY_LOCAL_MACHINE\Software\Klapwijk\WindowsDefenderUpdate\v1.0" 35 | $NOW = Get-Date -Format "yyyyMMdd-hhmmss" 36 | 37 | If ($ErrorLevel -eq "0") { 38 | [microsoft.win32.registry]::SetValue($Key, "Success", $NOW) 39 | } else { 40 | [microsoft.win32.registry]::SetValue($Key, "Failure", $NOW) 41 | [microsoft.win32.registry]::SetValue($Key, "Error Code", $Errorlevel) 42 | } 43 | 44 | # Exit Script with the specified ErrorLevel 45 | Stop-Transcript | Out-Null 46 | EXIT $ErrorLevel 47 | } 48 | #endregion Functions 49 | 50 | 51 | # Start Transcript 52 | $Transcript = "C:\programdata\Microsoft\IntuneManagementExtension\Logs\$($(Split-Path $PSCommandPath -Leaf).ToLower().Replace(".ps1",".log"))" 53 | Start-Transcript -Path $Transcript | Out-Null 54 | 55 | 56 | # Get current Windows Defender Status 57 | Write-Output "Get current Windows Defender Status:" 58 | Get-MpComputerStatus | FL AMEngineVersion,AMProductVersion,AntivirusSignatureLastUpdated,RealTimeProtectionEnabled 59 | 60 | # Microsoft Antimalware Service Command Line Utility 61 | $MpCmdRun = "C:\Program Files\Windows Defender\MpCmdRun.exe" 62 | If (Test-Path $MpCmdRun -PathType Leaf) { 63 | 64 | Write-Output "Force Windows Defender Update" 65 | $UpdateResult = & $MpCmdRun -SignatureUpdate -MMPC 66 | Write-Output $UpdateResult 67 | 68 | } Else { 69 | 70 | Write-Output "Cannot find the Microsoft Antimalware Service Command Line Utility: $MpCmdRun" 71 | } 72 | 73 | # Get updated Windows Defender Status 74 | Write-Output "Get updated Windows Defender Status:" 75 | Get-MpComputerStatus | FL AMEngineVersion,AMProductVersion,AntivirusSignatureLastUpdated,RealTimeProtectionEnabled 76 | 77 | CleanUpAndExit -ErrorLevel 0 -------------------------------------------------------------------------------- /Automatically Update Microsoft Edge/EdgeUpdateAutopilot.ps1: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------------- # 2 | # Author(s) : Peter Klapwijk - www.InTheCloud247.com # 3 | # Contributor : Mathieu Ait Azzouzene # 4 | # Version : 1.1 # 5 | # # 6 | # Description : Updates Microsoft Edge during AP enrollment as Windows is # 7 | # delivered with an outdated Edge version # 8 | # # 9 | # This script is provide "As-Is" without any warranties # 10 | # # 11 | # ---------------------------------------------------------------------------- # 12 | 13 | param ( 14 | [Parameter(Mandatory = $False)] 15 | [ValidateNotNullorEmpty()] 16 | [ValidateSet('Stable', 'Beta', 'Canary', 'Dev')] 17 | [String] 18 | $UpdateChannel = 'Stable', 19 | [Parameter(Mandatory = $False)] 20 | [ValidateNotNullorEmpty()] 21 | [ValidateSet('x86', 'x64', 'arm64')] 22 | [String] 23 | $Architecture = 'x64' 24 | ) 25 | 26 | # Microsoft Intune Management Extension might start a 32-bit PowerShell instance. If so, restart as 64-bit PowerShell 27 | If ($ENV:PROCESSOR_ARCHITEW6432 -eq "AMD64") { 28 | Try { 29 | &"$ENV:WINDIR\SysNative\WindowsPowershell\v1.0\PowerShell.exe" -File $PSCOMMANDPATH 30 | } 31 | Catch { 32 | Throw "Failed to start $PSCOMMANDPATH" 33 | } 34 | Exit 35 | } 36 | 37 | Function CleanUpAndExit() { 38 | Param( 39 | [Parameter(Mandatory=$True)][String]$ErrorLevel 40 | ) 41 | 42 | # Write results to registry for Intune Detection 43 | $Key = "HKEY_LOCAL_MACHINE\Software\$StoreResults" 44 | $NOW = Get-Date -Format "yyyyMMdd-hhmmss" 45 | 46 | If ($ErrorLevel -eq "0") { 47 | [microsoft.win32.registry]::SetValue($Key, "Success", $NOW) 48 | } else { 49 | [microsoft.win32.registry]::SetValue($Key, "Failure", $NOW) 50 | [microsoft.win32.registry]::SetValue($Key, "Error Code", $Errorlevel) 51 | } 52 | 53 | # Exit Script with the specified ErrorLevel 54 | EXIT $ErrorLevel 55 | } 56 | 57 | $ExitCode = 0 58 | 59 | #Results stored in the registry for Intune detection. Change to your needs. 60 | $StoreResults = "InTheCloud247\EdgeUpdateAutopilot\v1.1" 61 | 62 | #Get Edge app GUID depending on the update channel 63 | switch ($UpdateChannel) { 64 | 'Stable' { $AppGUID = '{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}' } 65 | 'Beta' { $AppGUID = '{2CD8A007-E189-409D-A2C8-9AF4EF3C72AA}' } 66 | 'Canary' { $AppGUID = '{65C35B14-6C1D-4122-AC46-7148CC9D6497}' } 67 | 'Dev' { $AppGUID = '{0D50BFEC-CD6A-4F9A-964C-C7416E3ACB10}' } 68 | } 69 | 70 | $Platform = 'Windows' 71 | 72 | # Start Transcript 73 | Start-Transcript -Append -Path "$env:ProgramData\Microsoft\IntuneManagementExtension\Logs\$($(Split-Path $PSCommandPath -Leaf).ToLower().Replace(".ps1",".log"))" | Out-Null 74 | 75 | #Determine original Microsoft Edge Version 76 | [System.Version]$EdgeVersionOld = (Get-AppxPackage -AllUsers -Name "Microsoft.MicrosoftEdge.$UpdateChannel").Version 77 | if (!($EdgeVersionOld)) { 78 | Write-Error "Microsoft Edge $UpdateChannel not installed, exiting" 79 | $ExitCode = 1 80 | } 81 | Else { 82 | Write-Host "Current Microsoft Edge $UpdateChannel version $EdgeVersionOld" 83 | #Determine latest Microsoft Edge Version depending on the update channel 84 | $EdgeInfo = (Invoke-WebRequest -UseBasicParsing -uri 'https://edgeupdates.microsoft.com/api/products?view=enterprise') 85 | 86 | [System.Version]$EdgeVersionLatest = ((($EdgeInfo.content | Convertfrom-json) | Where-Object {$_.product -eq $UpdateChannel}).releases | Where-Object {$_.Platform -eq $Platform -and $_.architecture -eq $architecture})[0].productversion 87 | Write-Host "Latest $UpdateChannel Microsoft Edge version is $EdgeVersionLatest" 88 | 89 | 90 | 91 | #Check if Microsoft Edge is already up to date 92 | If ($EdgeVersionOld -ge $EdgeVersionLatest) { 93 | Write-Host "Microsoft Edge $UpdateChannel already up to date" 94 | } 95 | else { 96 | #Trigger Microsoft Edge update 97 | Write-Host "Launching Microsoft Edge $UpdateChannel update" 98 | Start-Process -FilePath "C:\Program Files (x86)\Microsoft\EdgeUpdate\MicrosoftEdgeUpdate.exe" -argumentlist "/silent /install appguid=$AppGUID&appname=Microsoft%20Edge&needsadmin=True" 99 | Write-Host "Sleeping for 60 seconds" 100 | Start-Sleep -Seconds 60 101 | 102 | #Getting new Microsoft Edge installed version 103 | [System.Version]$EdgeVersionNew = (Get-AppxPackage -AllUsers -Name "Microsoft.MicrosoftEdge.$UpdateChannel").Version 104 | 105 | # Do While Loop to wait until Microsoft Edge Version updated if required 106 | Do { 107 | [System.Version]$EdgeVersionNew = (Get-AppxPackage -AllUsers -Name "Microsoft.MicrosoftEdge.$UpdateChannel").Version 108 | Write-Host "Checking current Edge version" 109 | Start-Sleep -Seconds 15 110 | } While ($EdgeVersionNew -lt $EdgeVersionLatest) 111 | Write-Host "Microsoft Edge $UpdateChannel version updated to $EdgeVersionNew" 112 | } 113 | } 114 | 115 | Stop-Transcript 116 | 117 | CleanUpAndExit -ErrorLevel $ExitCode 118 | -------------------------------------------------------------------------------- /Automatically Update Microsoft Edge/README.md: -------------------------------------------------------------------------------- 1 | ![This is an image](https://www.inthecloud247.com/wp-content/uploads/2022/06/GitHub-PowerShell.png) 2 | 3 | This is an example of how we can automatically update Microsoft Edge (for example during Autopilot enrollment). 4 | 5 | An option to deploy the scripts is to wrap them as a win32 app and deploy the package with Microsoft Intune (during Autopilot enrollment). 6 | 7 | The logs are saved on %programdata%\Microsoft\IntuneManagementExtension\Logs. This makes it available in the Device Diagnostics for Intune. 8 | 9 | The related blog post can be found here [Here](https://inthecloud247.com/update-microsoft-edge-during-windows-autopilot-enrollments/) 10 | -------------------------------------------------------------------------------- /Configure Time Zone/READMe.md: -------------------------------------------------------------------------------- 1 | ![This is an image](https://www.inthecloud247.com/wp-content/uploads/2022/06/GitHub-PowerShell.png) 2 | 3 | This is an example of a solution to automatically configure the time zone on a Windows device (for example during Autopilot enrollment). 4 | *The original solution used is not my own creation, but was previously found in a comment on another website.* 5 | *As I couldn't find that comment anymore and I think it might still be interesting for others I share it here.* 6 | 7 | *The solution makes use of https://ipinfo.io to retrieve the location of the device. Please note the API request limits of this service!* 8 | *The solution also makes use of Bing Maps Dev Center. Via the API of this service the loction is converted to a Time Zone.* 9 | *Check the license agreement if a basic key (free) key is suitable for your needs!* 10 | 11 | An option to deploy the scripts is to wrap them as a win32 app and deploy the package with Microsoft Intune (during Autopilot enrollment). 12 | 13 | The logs are saved on %programdata%\Microsoft\IntuneManagementExtension\Logs. This makes it available in the Device Diagnostics for Intune. 14 | 15 | The related blog post can be found here [Here](https://inthecloud247.com/automatically-configure-the-time-zone-during-autopilot-enrollment/) 16 | -------------------------------------------------------------------------------- /Configure Time Zone/SetTimeZone.ps1: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------------- # 2 | # Author(s) : Peter Klapwijk - www.inthecloud247.com # 3 | # : Johannes Muller - Co-author @ www.2azure.nl # 4 | # Original script from Koen Van den Broeck # 5 | # Version : 2.2 # 6 | # # 7 | # Description : Automatically configure the time zone using Azure Maps # 8 | # Uses `timezone/enumWindows` API to dynamically map time zones # 9 | # # 10 | # Notes: # 11 | # https://ipinfo.io/ has a limit of 50k requests per month without a license # 12 | # # 13 | # This script is provide "As-Is" without any warranties # 14 | # # 15 | # ---------------------------------------------------------------------------- # 16 | 17 | # Microsoft Intune Management Extension might start a 32-bit PowerShell instance. If so, restart as 64-bit PowerShell 18 | If ($ENV:PROCESSOR_ARCHITEW6432 -eq "AMD64") { 19 | Try { 20 | &"$ENV:WINDIR\SysNative\WindowsPowershell\v1.0\PowerShell.exe" -File $PSCOMMANDPATH 21 | } 22 | Catch { 23 | Throw "Failed to start $PSCOMMANDPATH" 24 | } 25 | Exit 26 | } 27 | 28 | #region Functions 29 | Function CleanUpAndExit() { 30 | Param( 31 | [Parameter(Mandatory=$True)][String]$ErrorLevel 32 | ) 33 | 34 | # Write results to registry for Intune Detection 35 | $Key = "HKEY_LOCAL_MACHINE\Software\$StoreResults" 36 | $NOW = Get-Date -Format "yyyyMMdd-hhmmss" 37 | 38 | If ($ErrorLevel -eq "0") { 39 | [microsoft.win32.registry]::SetValue($Key, "Success", $NOW) 40 | } else { 41 | [microsoft.win32.registry]::SetValue($Key, "Failure", $NOW) 42 | [microsoft.win32.registry]::SetValue($Key, "Error Code", $Errorlevel) 43 | } 44 | 45 | # Exit Script with the specified ErrorLevel 46 | Stop-Transcript | Out-Null 47 | EXIT $ErrorLevel 48 | } 49 | #endregion Functions 50 | 51 | # ------------------------------------------------------------------------------------------------------- # 52 | # Variables, change to your needs 53 | # ------------------------------------------------------------------------------------------------------- # 54 | $StoreResults = "COMPANY\TimeZone\v2.1" 55 | $AzureMapsKey = "xxxxx" 56 | 57 | # Start Transcript 58 | Start-Transcript -Path "$env:ProgramData\Microsoft\IntuneManagementExtension\Logs\$($(Split-Path $PSCommandPath -Leaf).ToLower().Replace(".ps1",".log"))" | Out-Null 59 | 60 | # Automatically configure the time zone 61 | # Clear previous errors 62 | $Error.Clear() 63 | 64 | # Retrieve IP information 65 | $IPInfo = Invoke-RestMethod http://ipinfo.io/json 66 | $CountryCode = $IPInfo.country 67 | 68 | Write-Output "Country Code: $CountryCode" 69 | 70 | # Retrieve all Windows Time Zones from Azure Maps 71 | $AzureMapsURL = "https://atlas.microsoft.com/timezone/enumWindows/json?api-version=1.0&subscription-key=$AzureMapsKey" 72 | $ResultTZ = Invoke-RestMethod -Uri $AzureMapsURL -Method Get 73 | # Retrieve Time Zone WindowsId 74 | $WindowsTZ = ($ResultTZ | Where-Object Territory -eq $CountryCode).WindowsId 75 | 76 | 77 | If (![string]::IsNullOrEmpty($WindowsTZ)) { 78 | Write-Output "Mapped Country code ($CountryCode) to Windows Time Zone: $WindowsTZ" 79 | } else { 80 | Write-Output "No matching Windows Time Zone found for country: $CountryCode" 81 | CleanUpAndExit -ErrorLevel 103 82 | } 83 | 84 | # Set the Windows time zone 85 | Set-TimeZone -Id $WindowsTZ 86 | Write-Output "Successfully set Windows Time Zone: $WindowsTZ" 87 | 88 | # Result 89 | If ($Error.Count -gt 0) { 90 | Write-Output "Configuring the Time Zone failed: $($Error[0])" 91 | CleanUpAndExit -ErrorLevel 101 92 | } else { 93 | Write-Output "Successfully configured the Time Zonw" 94 | } 95 | 96 | CleanUpAndExit -ErrorLevel 0 97 | -------------------------------------------------------------------------------- /DriveMappings/DriveMappingsv1.0_CreateScheduledTask.ps1: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------------------------------------ # 2 | # Author(s) : Peter Klapwijk - www.inthecloud247.com # 3 | # Version : 1.0 # 4 | # # 5 | # Description : Create a Scheduled task to connect drive mapping(s). Task runs on network change. # 6 | # # 7 | # Changes : v1.0 - Initial version # 8 | # # 9 | # This script is provide "As-Is" without any warranties # 10 | # # 11 | #------------------------------------------------------------------------------------------------------------- # 12 | 13 | # Microsoft Intune Management Extension might start a 32-bit PowerShell instance. If so, restart as 64-bit PowerShell 14 | If ($ENV:PROCESSOR_ARCHITEW6432 -eq "AMD64") { 15 | Try { 16 | &"$ENV:WINDIR\SysNative\WindowsPowershell\v1.0\PowerShell.exe" -File $PSCOMMANDPATH 17 | } 18 | Catch { 19 | Throw "Failed to start $PSCOMMANDPATH" 20 | } 21 | Exit 22 | } 23 | 24 | # ------------------------------------------------------------------------------------------------------- # 25 | # Variables 26 | # ------------------------------------------------------------------------------------------------------- # 27 | $CompanyName = "Klapwijk" 28 | $TaskScriptName = "DriveMappingsv1.0_ScriptRunFromTaskScheduler.vbs" 29 | $TaskScriptName2 = "DriveMappingsv1.0_ScriptRunFromTaskScheduler.ps1" 30 | $TaskScriptFolder = "C:\Program Files\Common Files\$CompanyName\DriveMappings" 31 | $ScriptSourceDirectory = Split-Path -Parent $PSCommandPath 32 | 33 | #region Functions 34 | Function CleanUpAndExit() { 35 | Param( 36 | [Parameter(Mandatory=$True)][String]$ErrorLevel 37 | ) 38 | 39 | # Write results to registry for Intune Detection 40 | $Key = "HKEY_LOCAL_MACHINE\Software\$CompanyName\DriveMappings\v1.0" 41 | $NOW = Get-Date -Format "yyyyMMdd-hhmmss" 42 | 43 | If ($ErrorLevel -eq "0") { 44 | [microsoft.win32.registry]::SetValue($Key, "Scheduled", $NOW) 45 | } else { 46 | [microsoft.win32.registry]::SetValue($Key, "Failure", $NOW) 47 | [microsoft.win32.registry]::SetValue($Key, "Error Code", $Errorlevel) 48 | } 49 | 50 | # Exit Script with the specified ErrorLevel 51 | Stop-Transcript | Out-Null 52 | EXIT $ErrorLevel 53 | } 54 | 55 | #endregion Functions 56 | 57 | 58 | # ------------------------------------------------------------------------------------------------------- # 59 | # Start Transcript 60 | # ------------------------------------------------------------------------------------------------------- # 61 | $Transcript = "C:\programdata\Microsoft\IntuneManagementExtension\Logs\$($(Split-Path $PSCommandPath -Leaf).ToLower().Replace(".ps1",".log"))" 62 | Start-Transcript -Path $Transcript | Out-Null 63 | 64 | 65 | # ------------------------------------------------------------------------------------------------------- # 66 | # Create local copy of the script to be run from the Task Scheduler 67 | # ------------------------------------------------------------------------------------------------------- # 68 | if (!(Test-Path -path $TaskScriptFolder)) { 69 | # Target Folder does not yet exist 70 | Write-Host "Creating Folder '$TaskScriptFolder' ..." 71 | New-Item $TaskScriptFolder -Type Directory | Out-Null 72 | } 73 | 74 | try { 75 | Write-Host "Source folder to copy script from: '$ScriptSourceDirectory'" 76 | Copy-Item "$ScriptSourceDirectory\$TaskScriptName" -Destination "$TaskScriptFolder" -ErrorAction Stop | Out-Null 77 | Write-Host "Created local copy of the script '$TaskScriptName' in folder: '$TaskScriptFolder'" 78 | } catch { 79 | Write-Host "ERROR creating local copy of the script '$TaskScriptName' in folder: '$TaskScriptFolder'" 80 | CleanUpAndExit -ErrorLevel 1 81 | } 82 | 83 | try { 84 | Write-Host "Source folder to copy script from: '$ScriptSourceDirectory'" 85 | Copy-Item "$ScriptSourceDirectory\$TaskScriptName2" -Destination "$TaskScriptFolder" -ErrorAction Stop | Out-Null 86 | Write-Host "Created local copy of the script '$TaskScriptName2' in folder: '$TaskScriptFolder'" 87 | } catch { 88 | Write-Host "ERROR creating local copy of the script '$TaskScriptName2' in folder: '$TaskScriptFolder'" 89 | CleanUpAndExit -ErrorLevel 1 90 | } 91 | 92 | # ------------------------------------------------------------------------------------------------------- # 93 | # Create Scheduled Task to run At Logon 94 | # ------------------------------------------------------------------------------------------------------- # 95 | # General parameters 96 | $TaskName = "Drive mappings" 97 | $TaskDescription = "Connect drive mappings" 98 | $TaskSettings = New-ScheduledTaskSettingsSet -Compatibility Win8 -MultipleInstances IgnoreNew -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -Hidden -StartWhenAvailable 99 | # Define the triggers of the scheduled task 100 | # Configure a trigger to run the script when a network change is detected 101 | $class = cimclass MSFT_TaskEventTrigger root/Microsoft/Windows/TaskScheduler 102 | $trigger = $class | New-CimInstance -ClientOnly 103 | $trigger 104 | $trigger.Enabled = $true 105 | $trigger.Subscription = '' 106 | # Define the action of the Scheduled task 107 | $TaskAction = New-ScheduledTaskAction -Execute "wscript.exe" -Argument "`"$TaskScriptFolder\$TaskScriptName`"" 108 | #Define the principal 109 | $TaskPrincipal = New-ScheduledTaskPrincipal -GroupId "S-1-5-32-545" 110 | # Register the Scheduled task 111 | Register-ScheduledTask -Action $TaskAction -Trigger $Trigger -Settings $TaskSettings -TaskPath $CompanyName -TaskName $TaskName -Description $TaskDescription -Principal $TaskPrincipal -Force 112 | 113 | 114 | # ------------------------------------------------------------------------------------------------------- # 115 | # Check End State 116 | # ------------------------------------------------------------------------------------------------------- # 117 | try { 118 | Get-ScheduledTask -TaskName $TaskName -ErrorAction Stop | Out-Null 119 | write-host "SUCCESS: Task is Scheduled." 120 | CleanUpAndExit -ErrorLevel 0 121 | } catch { 122 | write-host "ERROR: Scheduled Task could not be found." 123 | CleanUpAndExit -ErrorLevel 2 124 | } 125 | -------------------------------------------------------------------------------- /DriveMappings/DriveMappingsv1.0_ScriptRunFromTaskScheduler.ps1: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------------------------------------ # 2 | # Author(s) : Peter Klapwijk - www.inthecloud247.com # 3 | # Version : 1.0 # 4 | # # 5 | # Description : Script that runs on network change and connects drive mapping(s) # 6 | # # 7 | # Changes : v1.0 - Initial version # 8 | # # 9 | # This script is provide "As-Is" without any warranties # 10 | # # 11 | #------------------------------------------------------------------------------------------------------------- # 12 | 13 | # ------------------------------------------------------------------------------------------------------- # 14 | # Functions 15 | # ------------------------------------------------------------------------------------------------------- # 16 | Function CleanUpAndExit() { 17 | Param( 18 | [Parameter(Mandatory=$True)][String]$ErrorLevel 19 | ) 20 | 21 | # Write results to log file 22 | $NOW = Get-Date -Format "yyyyMMdd-hhmmss" 23 | 24 | If ($ErrorLevel -eq "0") { 25 | Write-Host "Drive mappings connected successfully at $NOW" 26 | } else { 27 | Write-Host "Connecting drive mappings failed at $NOW with error $Errorlevel" 28 | } 29 | 30 | # Exit Script with the specified ErrorLevel 31 | Stop-Transcript | Out-Null 32 | EXIT $ErrorLevel 33 | } 34 | 35 | function Test-DCConnection 36 | { 37 | $DCConnection = Test-Connection domain.local -Count 1 38 | return ($DCConnection -ne $null) 39 | } 40 | 41 | function Test-DriveMappingK 42 | { 43 | $DriveMappingK = Get-PSDrive -Name "K" -erroraction 'silentlycontinue' 44 | return ($DriveMappingK -ne $null) 45 | } 46 | 47 | function Test-DriveMappingM 48 | { 49 | $DriveMappingK = Get-PSDrive -Name "M" -erroraction 'silentlycontinue' 50 | return ($DriveMappingK -ne $null) 51 | } 52 | 53 | # ------------------------------------------------------------------------------------------------------- # 54 | # Start Transcript 55 | # ------------------------------------------------------------------------------------------------------- # 56 | $Transcript = "C:\programdata\Microsoft\IntuneManagementExtension\Logs\$($(Split-Path $PSCommandPath -Leaf).ToLower().Replace(".ps1",".log"))" 57 | Start-Transcript -Path $Transcript | Out-Null 58 | 59 | # ------------------------------------------------------------------------------------------------------- # 60 | # Check domain connectivity 61 | # ------------------------------------------------------------------------------------------------------- # 62 | 63 | if (Test-DCConnection -eq $True){ 64 | Write-Host "STATUS: Domain connection OK" 65 | } 66 | else { 67 | Write-Host "STATUS: No connection with the domain. Unable to connect drive mappings!" 68 | CleanUpAndExit -ErrorLevel 1 69 | } 70 | 71 | # ------------------------------------------------------------------------------------------------------- # 72 | # Add drive mapping(s) 73 | # ------------------------------------------------------------------------------------------------------- # 74 | 75 | if (Test-DriveMappingK -eq $True){ 76 | Write-Host "A drive with the name 'K' already exists" 77 | } 78 | else { 79 | New-PSDrive -Name "K" -PSProvider FileSystem -Root "\\FileServer\Share1" -Persist -Scope Global 80 | Write-Host "Drive K: is connected" 81 | } 82 | 83 | if (Test-DriveMappingM -eq $True){ 84 | Write-Host "A drive with the name 'M' already exists" 85 | } 86 | else { 87 | New-PSDrive -Name "M" -PSProvider FileSystem -Root "\\FileServer\Share2" -Persist -Scope Global 88 | Write-Host "Drive M: is connected" 89 | } 90 | 91 | # ------------------------------------------------------------------------------------------------------- # 92 | # Check end state 93 | # ------------------------------------------------------------------------------------------------------- # 94 | 95 | if (Test-DriveMappingK -eq $True){ 96 | Write-Host "STATUS: K: drive connected" 97 | } 98 | else { 99 | Write-Host "STATUS: K: drive not connected, unknown error" 100 | CleanUpAndExit -ErrorLevel 2 101 | } 102 | 103 | if (Test-DriveMappingM -eq $True){ 104 | Write-Host "STATUS: M: drive connected" 105 | CleanUpAndExit -ErrorLevel 0 106 | } 107 | else { 108 | Write-Host "STATUS: M: drive not connected, unknown error" 109 | CleanUpAndExit -ErrorLevel 2 110 | } -------------------------------------------------------------------------------- /DriveMappings/DriveMappingsv1.0_ScriptRunFromTaskScheduler.vbs: -------------------------------------------------------------------------------- 1 | 'Change COMPANY in your own company name 2 | Dim strArgs 3 | Set oShell = CreateObject ("Wscript.Shell") 4 | strArgs = "powershell.exe -executionpolicy bypass -windowstyle hidden -file C:\PROGRA~1\COMMON~1\Company\DRIVEM~1\DriveMappingsv1.0_ScriptRunFromTaskScheduler.ps1" 5 | oShell.Run strArgs, 0, false -------------------------------------------------------------------------------- /DriveMappings/READMe.md: -------------------------------------------------------------------------------- 1 | ![This is an image](https://www.inthecloud247.com/wp-content/uploads/2022/06/GitHub-PowerShell.png) 2 | 3 | This is an example of a solution to connect drive mappings on Windows devices. 4 | 5 | 1. DriveMappingsv1.0_CreateScheduledTask creates a scheduled task. 6 | 2. The scheduled task runs when a network change is detected, based on event id 10000 (Path="Microsoft-Windows-NetworkProfile/Operational). 7 | 3. The scheduled task runs a vbs script, this is used to avoid user pop-ups. 8 | 4. The vbs script runs the DriveMappingsv1.0_ScriptRunFromTaskScheduler.ps1 which connects the drive mappings. 9 | 5. The PS script first checks domain connectivity after which it checks if the drive mappings already exist. 10 | 6. If the drive mapping does not exist, the drive mapping is connected by the script. 11 | 12 | An option to deploy the scripts is to wrap them as a win32 app and deploy the package with Microsoft Intune. 13 | 14 | The logs are saved on %programdata%\Microsoft\IntuneManagementExtension\Logs. This makes it available in the Device Diagnostics for Intune. 15 | 16 | 17 | My website can be found here [Here](https://www.inthecloud247.com/) 18 | -------------------------------------------------------------------------------- /Install-LanguageExperiencePack_Windows11nl-NL/Install-LanguageExperiencePack_Windows11nl-NL.ps1: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------------------------------------ # 2 | # Author(s) : Peter Klapwijk - www.inthecloud247.com # 3 | # (Part of the script is from script from www.oliverkieselbach.com) # 4 | # Version : 1.0 # 5 | # # 6 | # Description : Install an additional language pack including FODs. # 7 | # Changes language for new users, welcome screen etc. # 8 | # Uses PowerShell commands only Supported on Windows 11 22H2 and later # 9 | # # 10 | # Changes : v1.0 - Initial published version # 11 | # # 12 | # This script is provide "As-Is" without any warranties # 13 | # # 14 | #------------------------------------------------------------------------------------------------------------- # 15 | 16 | # Microsoft Intune Management Extension might start a 32-bit PowerShell instance. If so, restart as 64-bit PowerShell 17 | If ($ENV:PROCESSOR_ARCHITEW6432 -eq "AMD64") { 18 | Try { 19 | &"$ENV:WINDIR\SysNative\WindowsPowershell\v1.0\PowerShell.exe" -File $PSCOMMANDPATH 20 | } 21 | Catch { 22 | Throw "Failed to start $PSCOMMANDPATH" 23 | } 24 | Exit 25 | } 26 | 27 | #Set variables: 28 | #Company name 29 | $CompanyName = "Klapwijk" 30 | # The language we want as new default. Language tag can be found here: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/available-language-packs-for-windows 31 | $language = "nl-NL" 32 | # Geographical ID we want to set. GeoID can be found here: https://learn.microsoft.com/en-us/windows/win32/intl/table-of-geographical-locations?redirectedfrom=MSDN 33 | $geoId = "176" # Netherlands 34 | 35 | # Start Transcript 36 | Start-Transcript -Path "$env:ProgramData\Microsoft\IntuneManagementExtension\Logs\$($(Split-Path $PSCommandPath -Leaf).ToLower().Replace(".ps1",".log"))" | Out-Null 37 | 38 | # custom folder for temp scripts 39 | "...creating custom temp script folder" 40 | $scriptFolderPath = "$env:SystemDrive\ProgramData\$CompanyName\CustomTempScripts" 41 | New-Item -ItemType Directory -Force -Path $scriptFolderPath 42 | "`n" 43 | 44 | $userConfigScriptPath = $(Join-Path -Path $scriptFolderPath -ChildPath "UserConfig.ps1") 45 | "...creating userconfig scripts" 46 | # we could encode the complete script to prevent the escaping of $, but I found it easier to maintain 47 | # to not encode. I do not have to decode/encode all the time for modifications. 48 | $userConfigScript = @" 49 | `$language = "$language" 50 | 51 | Start-Transcript -Path "`$env:TEMP\LXP-UserSession-Config-`$language.log" | Out-Null 52 | 53 | `$geoId = $geoId 54 | 55 | # important for regional change like date and time... 56 | "Set-WinUILanguageOverride = `$language" 57 | Set-WinUILanguageOverride -Language `$language 58 | 59 | "Set-WinUserLanguageList = `$language" 60 | 61 | `$OldList = Get-WinUserLanguageList 62 | `$UserLanguageList = New-WinUserLanguageList -Language `$language 63 | `$UserLanguageList += `$OldList | where { `$_.LanguageTag -ne `$language } 64 | "Setting new user language list:" 65 | `$UserLanguageList | select LanguageTag 66 | "" 67 | "Set-WinUserLanguageList -LanguageList ..." 68 | Set-WinUserLanguageList -LanguageList `$UserLanguageList -Force 69 | 70 | "Set-Culture = `$language" 71 | Set-Culture -CultureInfo `$language 72 | 73 | "Set-WinHomeLocation = `$geoId" 74 | Set-WinHomeLocation -GeoId `$geoId 75 | 76 | Stop-Transcript -Verbose 77 | "@ 78 | 79 | $userConfigScriptHiddenStarterPath = $(Join-Path -Path $scriptFolderPath -ChildPath "UserConfigHiddenStarter.vbs") 80 | $userConfigScriptHiddenStarter = @" 81 | sCmd = "powershell.exe -ex bypass -file ""$userConfigScriptPath""" 82 | Set oShell = CreateObject("WScript.Shell") 83 | oShell.Run sCmd,0,true 84 | "@ 85 | 86 | # Install an additional language pack including FODs 87 | "Installing languagepack" 88 | Install-Language $language -CopyToSettings 89 | 90 | #Set System Preferred UI Language 91 | "Set SystemPreferredUILanguage" 92 | Set-SystemPreferredUILanguage $language 93 | 94 | #Check status of the installed language pack 95 | "Checking installed languagepack status" 96 | $installedLanguage = (Get-InstalledLanguage).LanguageId 97 | 98 | if ($installedLanguage -like $language){ 99 | Write-Host "Language $language installed" 100 | } 101 | else { 102 | Write-Host "Failure! Language $language NOT installed" 103 | Exit 1 104 | } 105 | 106 | #Check status of the System Preferred Language 107 | $SystemPreferredUILanguage = Get-SystemPreferredUILanguage 108 | 109 | if ($SystemPreferredUILanguage -like $language){ 110 | Write-Host "System Preferred UI Language set to $language. OK" 111 | } 112 | else { 113 | Write-Host "Failure! System Preferred UI Language NOT set to $language. System Preferred UI Language is $SystemPreferredUILanguage" 114 | Exit 1 115 | } 116 | 117 | # Configure new language defaults under current user (system account) after which it can be copied to the system 118 | #Set Win UI Language Override for regional changes 119 | "Set WinUILanguageOverride" 120 | Set-WinUILanguageOverride -Language $language 121 | 122 | # Set Win User Language List, sets the current user language settings 123 | "Set WinUserLanguageList" 124 | $OldList = Get-WinUserLanguageList 125 | $UserLanguageList = New-WinUserLanguageList -Language $language 126 | $UserLanguageList += $OldList | where { $_.LanguageTag -ne $language } 127 | $UserLanguageList | select LanguageTag 128 | Set-WinUserLanguageList -LanguageList $UserLanguageList -Force 129 | 130 | # Set Culture, sets the user culture for the current user account. 131 | "Set culture" 132 | Set-Culture -CultureInfo $language 133 | 134 | # Set Win Home Location, sets the home location setting for the current user 135 | "Set WinHomeLocation" 136 | Set-WinHomeLocation -GeoId $geoId 137 | 138 | # Copy User Internaltional Settings from current user to System, including Welcome screen and new user 139 | "Copy UserInternationalSettingsToSystem " 140 | Copy-UserInternationalSettingsToSystem -WelcomeScreen $True -NewUser $True 141 | 142 | # we have to switch the language for the current user session. The powershell cmdlets must be run in the current logged on user context. 143 | # creating a temp scheduled task to run on-demand in the current user context does the trick here. 144 | "Trigger language change for current user session via ScheduledTask = LXP-UserSession-Config-$language" 145 | Out-File -FilePath $userConfigScriptPath -InputObject $userConfigScript -Encoding ascii 146 | Out-File -FilePath $userConfigScriptHiddenStarterPath -InputObject $userConfigScriptHiddenStarter -Encoding ascii 147 | 148 | # REMARK: usag of wscript as hidden starter may be blocked because of security restrictions like AppLocker, ASR, etc... 149 | # switch to PowerShell if this represents a problem in your environment. 150 | $taskName = "LXP-UserSession-Config-$language" 151 | $action = New-ScheduledTaskAction -Execute "wscript.exe" -Argument """$userConfigScriptHiddenStarterPath""" 152 | $trigger = New-ScheduledTaskTrigger -AtLogOn 153 | $principal = New-ScheduledTaskPrincipal -UserId (Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -expand UserName) 154 | $settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries 155 | $task = New-ScheduledTask -Action $action -Trigger $trigger -Principal $principal -Settings $settings 156 | Register-ScheduledTask $taskName -InputObject $task 157 | Start-ScheduledTask -TaskName $taskName 158 | 159 | Start-Sleep -Seconds 30 160 | 161 | Unregister-ScheduledTask -TaskName $taskName -Confirm:$false 162 | 163 | # trigger 'LanguageComponentsInstaller\ReconcileLanguageResources' otherwise 'Windows Settings' need a long time to change finally 164 | "Trigger ScheduledTask = LanguageComponentsInstaller\ReconcileLanguageResources" 165 | Start-ScheduledTask -TaskName "\Microsoft\Windows\LanguageComponentsInstaller\ReconcileLanguageResources" 166 | 167 | Start-Sleep 10 168 | 169 | # trigger store updates, there might be new app versions due to the language change 170 | "Trigger MS Store updates for app updates" 171 | Get-CimInstance -Namespace "root\cimv2\mdm\dmmap" -ClassName "MDM_EnterpriseModernAppManagement_AppManagement01" | Invoke-CimMethod -MethodName "UpdateScanMethod" 172 | 173 | 174 | # Add registry key for Intune detection 175 | "Add registry key for Intune detection" 176 | REG add "HKLM\Software\$CompanyName\LanguageXPWIN11\v1.0" /v "SetLanguage-$language" /t REG_DWORD /d 1 177 | 178 | Exit 0 179 | Stop-Transcript -------------------------------------------------------------------------------- /Install-LanguageExperiencePack_Windows11nl-NL/README.md: -------------------------------------------------------------------------------- 1 | ![This is an image](https://www.inthecloud247.com/wp-content/uploads/2022/06/GitHub-PowerShell.png) 2 | 3 | * Install an additional language pack including FODs and change the complete system to another language. 4 | * Changes language for new users, welcome screen etc. 5 | * Uses PowerShell commands only Supported on Windows 11 22H2 and later 6 | 7 | This script is provide "As-Is" without any warranties 8 | 9 | The related blog post can be found [here](https://www.inthecloud247.com/how-to-change-the-windows-11-language-with-intune/) 10 | 11 | 12 | *Note; if you are going to test the script in Hyper-V, turn off enhanced view.* 13 | -------------------------------------------------------------------------------- /InstallLanguagePackDuringAutopilotESP_Windows11nl-NL/InstallLanguagePackDuringAutopilotESP_Windows11nl-NL.ps1: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------------------------------------ # 2 | # Author(s) : Peter Klapwijk - www.inthecloud247.com # 3 | # Version : 1.1 # 4 | # # 5 | # Description : Install an additional language pack during Autopilot ESP. # 6 | # Changes language for new users, welcome screen etc. # 7 | # Uses PowerShell commands only Supported on Windows 11 22H2 and later # 8 | # # 9 | # Changes : v1.0 - Initial version # 10 | # v1.1 - Split up language pack and input locale language as these are not always the same # 11 | # # 12 | # This script is provide "As-Is" without any warranties # 13 | # # 14 | #------------------------------------------------------------------------------------------------------------- # 15 | 16 | # Microsoft Intune Management Extension might start a 32-bit PowerShell instance. If so, restart as 64-bit PowerShell 17 | If ($ENV:PROCESSOR_ARCHITEW6432 -eq "AMD64") { 18 | Try { 19 | &"$ENV:WINDIR\SysNative\WindowsPowershell\v1.0\PowerShell.exe" -File $PSCOMMANDPATH 20 | } 21 | Catch { 22 | Throw "Failed to start $PSCOMMANDPATH" 23 | } 24 | Exit 25 | } 26 | 27 | # Start Transcript 28 | Start-Transcript -Path "$env:ProgramData\Microsoft\IntuneManagementExtension\Logs\$($(Split-Path $PSCommandPath -Leaf).ToLower().Replace(".ps1",".log"))" | Out-Null 29 | 30 | #Set variables (change to your needs): 31 | "Set variables" 32 | #Company name 33 | $CompanyName = "Klapwijk" 34 | "CompanyName = $CompanyName" 35 | # The language we want as new default. Language tag can be found here: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/available-language-packs-for-windows 36 | $LPlanguage = "nl-NL" 37 | "LPlanguage = $LPlanguage" 38 | # As In some countries the input locale might differ from the installed language pack language, we use a separate input local variable. 39 | # A list of input locales can be found here: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-input-locales-for-windows-language-packs 40 | $inputlocale = "nl-NL" 41 | "inputlocale = $inputlocale" 42 | # Geographical ID we want to set. GeoID can be found here: https://learn.microsoft.com/en-us/windows/win32/intl/table-of-geographical-locations?redirectedfrom=MSDN 43 | $geoId = "176" # Netherlands 44 | "geoId = $geoId" 45 | 46 | #Install language pack and change the language of the OS on different places 47 | 48 | #Install an additional language pack including FODs 49 | "Installing languagepack" 50 | Install-Language $LPlanguage -CopyToSettings 51 | 52 | #Check status of the installed language pack 53 | "Checking installed languagepack status" 54 | $installedLanguage = (Get-InstalledLanguage).LanguageId 55 | 56 | if ($installedLanguage -like $LPlanguage){ 57 | Write-Host "Language $LPlanguage installed" 58 | } 59 | else { 60 | Write-Host "Failure! Language $LPlanguage NOT installed" 61 | Exit 1 62 | } 63 | 64 | #Set System Preferred UI Language 65 | "Set SystemPreferredUILanguage $inputlocale" 66 | Set-SystemPreferredUILanguage $inputlocale 67 | 68 | # Configure new language defaults under current user (system) after which it can be copied to system 69 | #Set Win UI Language Override for regional changes 70 | "Set WinUILanguageOverride $inputlocale" 71 | Set-WinUILanguageOverride -Language $inputlocale 72 | 73 | # Set Win User Language List, sets the current user language settings 74 | "Set WinUserLanguageList" 75 | $OldList = Get-WinUserLanguageList 76 | $UserLanguageList = New-WinUserLanguageList -Language $inputlocale 77 | $UserLanguageList += $OldList | where { $_.LanguageTag -ne $inputlocale } 78 | $UserLanguageList | select LanguageTag 79 | Set-WinUserLanguageList -LanguageList $UserLanguageList -Force 80 | 81 | # Set Culture, sets the user culture for the current user account. 82 | "Set culture $inputlocale" 83 | Set-Culture -CultureInfo $inputlocale 84 | 85 | # Set Win Home Location, sets the home location setting for the current user 86 | "Set WinHomeLocation $geoId" 87 | Set-WinHomeLocation -GeoId $geoId 88 | 89 | # Copy User Internaltional Settings from current user to System, including Welcome screen and new user 90 | "Copy UserInternationalSettingsToSystem" 91 | Copy-UserInternationalSettingsToSystem -WelcomeScreen $True -NewUser $True 92 | 93 | # Add registry key for Intune detection 94 | "Add registry key for Intune detection to HKLM\Software\$CompanyName\LanguageXPWIN11ESP\" 95 | REG add "HKLM\Software\$CompanyName\LanguageXPWIN11ESP\v1.1" /v "SetLanguage-$inputlocale" /t REG_DWORD /d 1 96 | 97 | Exit 3010 98 | Stop-Transcript 99 | -------------------------------------------------------------------------------- /InstallLanguagePackDuringAutopilotESP_Windows11nl-NL/README.md: -------------------------------------------------------------------------------- 1 | ![This is an image](https://www.inthecloud247.com/wp-content/uploads/2022/06/GitHub-PowerShell.png) 2 | 3 | * Install an additional language pack during Autopilot enrollment 4 | * Changes language for system coount, new user accounts, welcome screen etc 5 | * Uses PowerShell commands only Supported on Windows 11 22H2 and later 6 | 7 | This script is provide "As-Is" without any warranties 8 | 9 | The related blog post can be found [Here](https://www.inthecloud247.com/install-an-additional-language-pack-on-windows-11-during-autopilot-enrollment) 10 | -------------------------------------------------------------------------------- /PrinterMapping/Printermappingv1.0_CreateScheduledTask.ps1: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------------------------------------ # 2 | # Author(s) : Peter Klapwijk - www.inthecloud247.com # 3 | # Version : 1.0 # 4 | # # 5 | # Description : Create a Scheduled task to map network printers. Task runs at user logon # 6 | # # 7 | # Changes : v1.0 - Initial version # 8 | # # 9 | # This script is provide "As-Is" without any warranties # 10 | # # 11 | #------------------------------------------------------------------------------------------------------------- # 12 | 13 | # Microsoft Intune Management Extension might start a 32-bit PowerShell instance. If so, restart as 64-bit PowerShell 14 | If ($ENV:PROCESSOR_ARCHITEW6432 -eq "AMD64") { 15 | Try { 16 | &"$ENV:WINDIR\SysNative\WindowsPowershell\v1.0\PowerShell.exe" -File $PSCOMMANDPATH 17 | } 18 | Catch { 19 | Throw "Failed to start $PSCOMMANDPATH" 20 | } 21 | Exit 22 | } 23 | 24 | # ------------------------------------------------------------------------------------------------------- # 25 | # Variables 26 | # ------------------------------------------------------------------------------------------------------- # 27 | $CompanyName = "Klapwijk" 28 | $TaskScriptName = "Printermappingv1.0_ScriptRunFromTaskScheduler.vbs" 29 | $TaskScriptName2 = "Printermappingv1.0_ScriptRunFromTaskScheduler.ps1" 30 | $TaskScriptFolder = "C:\Program Files\Common Files\$CompanyName\PrinterMapping" 31 | $ScriptSourceDirectory = Split-Path -Parent $PSCommandPath 32 | 33 | #region Functions 34 | Function CleanUpAndExit() { 35 | Param( 36 | [Parameter(Mandatory=$True)][String]$ErrorLevel 37 | ) 38 | 39 | # Write results to registry for Intune Detection 40 | $Key = "HKEY_LOCAL_MACHINE\Software\$CompanyName\PrinterMapping\v1.0" 41 | $NOW = Get-Date -Format "yyyyMMdd-hhmmss" 42 | 43 | If ($ErrorLevel -eq "0") { 44 | [microsoft.win32.registry]::SetValue($Key, "Scheduled", $NOW) 45 | } else { 46 | [microsoft.win32.registry]::SetValue($Key, "Failure", $NOW) 47 | [microsoft.win32.registry]::SetValue($Key, "Error Code", $Errorlevel) 48 | } 49 | 50 | # Exit Script with the specified ErrorLevel 51 | Stop-Transcript | Out-Null 52 | EXIT $ErrorLevel 53 | } 54 | 55 | #endregion Functions 56 | 57 | 58 | # ------------------------------------------------------------------------------------------------------- # 59 | # Start Transcript 60 | # ------------------------------------------------------------------------------------------------------- # 61 | $Transcript = "C:\programdata\Microsoft\IntuneManagementExtension\Logs\$($(Split-Path $PSCommandPath -Leaf).ToLower().Replace(".ps1",".log"))" 62 | Start-Transcript -Path $Transcript | Out-Null 63 | 64 | 65 | # ------------------------------------------------------------------------------------------------------- # 66 | # Create local copy of the script to be run from the Task Scheduler 67 | # ------------------------------------------------------------------------------------------------------- # 68 | if (!(Test-Path -path $TaskScriptFolder)) { 69 | # Target Folder does not yet exist 70 | Write-Host "Creating Folder '$TaskScriptFolder' ..." 71 | New-Item $TaskScriptFolder -Type Directory | Out-Null 72 | } 73 | 74 | try { 75 | Write-Host "Source folder to copy script from: '$ScriptSourceDirectory'" 76 | Copy-Item "$ScriptSourceDirectory\$TaskScriptName" -Destination "$TaskScriptFolder" -ErrorAction Stop | Out-Null 77 | Write-Host "Created local copy of the script '$TaskScriptName' in folder: '$TaskScriptFolder'" 78 | } catch { 79 | Write-Host "ERROR creating local copy of the script '$TaskScriptName' in folder: '$TaskScriptFolder'" 80 | CleanUpAndExit -ErrorLevel 1 81 | } 82 | 83 | try { 84 | Write-Host "Source folder to copy script from: '$ScriptSourceDirectory'" 85 | Copy-Item "$ScriptSourceDirectory\$TaskScriptName2" -Destination "$TaskScriptFolder" -ErrorAction Stop | Out-Null 86 | Write-Host "Created local copy of the script '$TaskScriptName2' in folder: '$TaskScriptFolder'" 87 | } catch { 88 | Write-Host "ERROR creating local copy of the script '$TaskScriptName2' in folder: '$TaskScriptFolder'" 89 | CleanUpAndExit -ErrorLevel 1 90 | } 91 | 92 | # ------------------------------------------------------------------------------------------------------- # 93 | # Create Scheduled Task to run At Logon 94 | # ------------------------------------------------------------------------------------------------------- # 95 | # General parameters 96 | $TaskName = "MapNetworkPrinters" 97 | $TaskDescription = "Map network printers" 98 | $TaskSettings = New-ScheduledTaskSettingsSet -Compatibility Win8 -MultipleInstances IgnoreNew -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -Hidden -StartWhenAvailable 99 | # Define the triggers of the scheduled task 100 | # Configure a trigger to run the script at logon of any user 101 | $Trigger = New-ScheduledTaskTrigger -AtLogon 102 | # Define the action of the Scheduled task 103 | $TaskAction = New-ScheduledTaskAction -Execute "wscript.exe" -Argument "`"$TaskScriptFolder\$TaskScriptName`"" 104 | #Define the principal 105 | $TaskPrincipal = New-ScheduledTaskPrincipal -GroupId "S-1-5-32-545" 106 | # Register the Scheduled task 107 | $ModifiedTask = Register-ScheduledTask -Action $TaskAction -Trigger $Trigger -Settings $TaskSettings -TaskPath $CompanyName -TaskName $TaskName -Description $TaskDescription -Principal $TaskPrincipal -Force 108 | # Modify Task to add a delay 109 | $ModifiedTask.Triggers[0].Delay = 'PT4M' 110 | Set-ScheduledTask -InputObject $ModifiedTask 111 | 112 | 113 | # ------------------------------------------------------------------------------------------------------- # 114 | # Check End State 115 | # ------------------------------------------------------------------------------------------------------- # 116 | try { 117 | Get-ScheduledTask -TaskName $TaskName -ErrorAction Stop | Out-Null 118 | write-host "SUCCESS: Task is Scheduled." 119 | CleanUpAndExit -ErrorLevel 0 120 | } catch { 121 | write-host "ERROR: Scheduled Task could not be found." 122 | CleanUpAndExit -ErrorLevel 2 123 | } 124 | -------------------------------------------------------------------------------- /PrinterMapping/Printermappingv1.0_ScriptRunFromTaskScheduler.ps1: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------------------------------------ # 2 | # Author(s) : Peter Klapwijk - www.inthecloud247.com # 3 | # Version : 1.0 # 4 | # # 5 | # Description : Script that runs at user logon and maps network printer(s) # 6 | # # 7 | # Changes : v1.0 - Initial version # 8 | # # 9 | # This script is provide "As-Is" without any warranties # 10 | # # 11 | #------------------------------------------------------------------------------------------------------------- # 12 | 13 | #region Functions 14 | Function CleanUpAndExit() { 15 | Param( 16 | [Parameter(Mandatory=$True)][String]$ErrorLevel 17 | ) 18 | 19 | # Write results to log file 20 | $NOW = Get-Date -Format "yyyyMMdd-hhmmss" 21 | 22 | If ($ErrorLevel -eq "0") { 23 | Write-Host "Printers added successfully at $NOW" 24 | } else { 25 | Write-Host "Adding printers failed at $NOW with error $Errorlevel" 26 | } 27 | 28 | # Exit Script with the specified ErrorLevel 29 | Stop-Transcript | Out-Null 30 | EXIT $ErrorLevel 31 | } 32 | 33 | function Test-DCConnection 34 | { 35 | $DCConnection = Test-Connection domain.internal -Count 1 36 | return ($DCConnection -ne $null) 37 | } 38 | 39 | function Test-PrinterBW 40 | { 41 | $PrinterBW = Get-Printer | Where-Object {$_.Name -eq "\\fps01.domain.internal\Printer-BW"} 42 | return ($PrinterBW -ne $null) 43 | } 44 | 45 | function Test-PrinterColour 46 | { 47 | $PrinterColour = Get-Printer | Where-Object {$_.Name -eq "\\fps01.domain.internal\Printer-Colour"} 48 | return ($PrinterColour -ne $null) 49 | } 50 | 51 | #endregion Functions 52 | 53 | # ------------------------------------------------------------------------------------------------------- # 54 | # Start Transcript 55 | # ------------------------------------------------------------------------------------------------------- # 56 | $Transcript = "C:\programdata\Microsoft\IntuneManagementExtension\Logs\$($(Split-Path $PSCommandPath -Leaf).ToLower().Replace(".ps1",".log"))" 57 | Start-Transcript -Path $Transcript | Out-Null 58 | 59 | # ------------------------------------------------------------------------------------------------------- # 60 | # Check domain connectivity 61 | # ------------------------------------------------------------------------------------------------------- # 62 | 63 | if (Test-DCConnection -eq $True){ 64 | Write-Host "STATUS: Domain connection OK" 65 | } 66 | else { 67 | Write-Host "STATUS: No connection with the domain. Unable to add printers!" 68 | CleanUpAndExit -ErrorLevel 1 69 | } 70 | 71 | # ------------------------------------------------------------------------------------------------------- # 72 | # Add printers 73 | # ------------------------------------------------------------------------------------------------------- # 74 | 75 | if (Test-PrinterBW -eq $True){ 76 | Write-Host "Printer BW already present" 77 | } 78 | else { 79 | Add-Printer -ConnectionName \\fps01.domain.internal\Printer-BW 80 | Write-Host "Printer BW added" 81 | } 82 | 83 | if (Test-PrinterColour -eq $True){ 84 | Write-Host "Printer Colour already present" 85 | } 86 | else { 87 | Add-Printer -ConnectionName \\fps01.domain.internal\Printer-Colour 88 | Write-Host "Printer Colour added" 89 | } 90 | 91 | 92 | # ------------------------------------------------------------------------------------------------------- # 93 | # Check end state 94 | # ------------------------------------------------------------------------------------------------------- # 95 | 96 | if (Test-PrinterBW -eq $True){ 97 | Write-Host "STATUS: Printer BW present" 98 | } 99 | else { 100 | Write-Host "STATUS: Printer BW NOT present, unknown error" 101 | CleanUpAndExit -ErrorLevel 2 102 | } 103 | 104 | if (Test-PrinterColour -eq $True){ 105 | Write-Host "STATUS: Printer Colour present" 106 | CleanUpAndExit -ErrorLevel 0 107 | } 108 | else { 109 | Write-Host "STATUS: Printer Colour NOT present, unknown error" 110 | CleanUpAndExit -ErrorLevel 2 111 | } 112 | -------------------------------------------------------------------------------- /PrinterMapping/Printermappingv1.0_ScriptRunFromTaskScheduler.vbs: -------------------------------------------------------------------------------- 1 | Dim strArgs 2 | Set oShell = CreateObject ("Wscript.Shell") 3 | strArgs = "powershell.exe -executionpolicy bypass -windowstyle hidden -file C:\PROGRA~1\COMMON~1\Klapwijk\PRINTE~1\Printermappingv1.0_ScriptRunFromTaskScheduler.ps1" 4 | oShell.Run strArgs, 0, false -------------------------------------------------------------------------------- /PrinterMapping/README.md: -------------------------------------------------------------------------------- 1 | ![This is an image](https://www.inthecloud247.com/wp-content/uploads/2022/06/GitHub-PowerShell.png) 2 | 3 | This is an example of a solution to map network printers on Windows devices. 4 | 5 | 1. Printermappingv1.0_CreateScheduledTask.ps1 creates a scheduled task. 6 | 2. The scheduled task runs when an user logs on to the device, with a short delay. 7 | 3. The scheduled task runs a vbs script, this is used to avoid user pop-ups. 8 | 4. The vbs script runs the Printermappingv1.0_ScriptRunFromTaskScheduler.ps1 which does the actual printer mapping. 9 | 5. The PS script first checks domain connectivity after which it checks if the printer is already mapped. 10 | 6. If the printer is not mapped, the printer is mapped by the script. 11 | 12 | An option to deploy the scripts is to wrap them as a win32 app and deploy the package with Microsoft Intune. 13 | 14 | The logs are saved on %programdata%\Microsoft\IntuneManagementExtension\Logs. This makes it available in the Device Diagnostics for Intune. 15 | 16 | *Note; depending on the needed printer driver, it might be needed to deploy the printer driver separated.* 17 | 18 | The related blog post can be found [Here](https://www.inthecloud247.com/manage-printer-mappings-on-cloud-managed-windows-devices/) 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![This is an image](https://www.inthecloud247.com/wp-content/uploads/2022/06/GitHub-PowerShell.png) 2 | 3 | Repository which holds PowerShell scripts, mostly related to Endpoint Management. 4 | 5 | Related blog posts can be found [Here](https://www.inthecloud247.com/) 6 | -------------------------------------------------------------------------------- /Remove new Outlook client/NewOutlookClient_Detection.ps1: -------------------------------------------------------------------------------- 1 | # Author(s) : Peter Klapwijk - www.inthecloud247.com 2 | # Description :Script detects the new Microsoft Outlook (preview) app. 3 | 4 | if ($null -eq (Get-AppxPackage -Name "Microsoft.OutlookForWindows")) { 5 | Write-Host "New Microsoft Outlook client not found" 6 | exit 0 7 | } Else { 8 | Write-Host "New Microsoft Outlook client found" 9 | Exit 1 10 | 11 | } 12 | -------------------------------------------------------------------------------- /Remove new Outlook client/NewOutlookClient_Remediation.ps1: -------------------------------------------------------------------------------- 1 | # Author(s) : Peter Klapwijk - www.inthecloud247.com 2 | # Description : Script removes the new Microsoft client (preview) app. 3 | # App is removed because we currently can't manage the app with GPO or Intune policy settings. 4 | 5 | try{ 6 | Get-AppxPackage -Name "Microsoft.OutlookForWindows" | Remove-AppxPackage -ErrorAction stop 7 | Write-Host "New Microsoft client (preview) app successfully removed" 8 | 9 | } 10 | catch{ 11 | Write-Error "Error removing Microsoft client (preview) app" 12 | } -------------------------------------------------------------------------------- /Remove new Outlook client/README.md: -------------------------------------------------------------------------------- 1 | ![This is an image](https://www.inthecloud247.com/wp-content/uploads/2022/06/GitHub-PowerShell.png) 2 | 3 | These are two scripts that can be used with Intune (Proactive) Remediation scripts to detect and remove the installation of the new Outlook (preview) client. 4 | The detection script (NewOutlookClient_Detection.ps1) is run on the Windows client and detects the installation of the new Outlook client. 5 | The remediation script (NewOutlookClient_Remediation.ps1) uninstalls the new Outlook client when this client is detected. 6 | 7 | The related blog post can be found [here](https://www.inthecloud247.com/hide-try-the-new-outlook-toggle-the-correct-way/) 8 | -------------------------------------------------------------------------------- /Uninstall Dev Home app/README.md: -------------------------------------------------------------------------------- 1 | ![This is an image](https://www.inthecloud247.com/wp-content/uploads/2022/06/GitHub-PowerShell.png) 2 | 3 | These are two scripts that can be used with Intune (Proactive) Remediation scripts to detect and remove the installation of the Dev Home app which is installed automatically on Windows (11) devices. 4 | The detection script (UninstallDevHome_Detection.ps1) is run on the Windows client and detects the installation of the Dev Home app. 5 | The remediation script (NUninstallDevHome_Remediation.ps1) uninstalls the Dev Home app when the app is detected. 6 | 7 | When using an Intune remediation, Set Run this script using the logged-on credentials to Yes 8 | -------------------------------------------------------------------------------- /Uninstall Dev Home app/UninstallDevHome_Detection.ps1: -------------------------------------------------------------------------------- 1 | #Script detects if the Dev Home UWP app is installed under the current user. 2 | 3 | if ($null -eq (Get-AppxPackage -Name "*Windows.DevHome*")) { 4 | Write-Host "Dev Home app not found" 5 | exit 0 6 | } Else { 7 | Write-Host "Dev Home app found" 8 | Exit 1 9 | 10 | } -------------------------------------------------------------------------------- /Uninstall Dev Home app/UninstallDevHome_Remediation.ps1: -------------------------------------------------------------------------------- 1 | #Script removes the Dev Home UWP app from the Windows device. 2 | #Run the script using an Intune remediation. Set Run this script using the logged-on credentials to Yes 3 | 4 | try{ 5 | Get-AppxPackage -Name "*Windows.DevHome*" | Remove-AppxPackage -ErrorAction stop 6 | Write-Host "Dev Home app successfully removed" 7 | 8 | } 9 | catch{ 10 | Write-Error "Error removing Dev Home" 11 | } -------------------------------------------------------------------------------- /modify Edge Link/README.md: -------------------------------------------------------------------------------- 1 | ![This is an image](https://www.inthecloud247.com/wp-content/uploads/2022/06/GitHub-PowerShell.png) 2 | 3 | Script modify Edge Link.ps1 is used to modify a .lnk file and add some arguments in the target field. 4 | In this example used to start Microsoft Edge full screen. 5 | 6 | 7 | Related blog post can be found [Here](https://www.inthecloud247.com/setup-edge-chromium-based-kiosk-device-with-microsoft-intune/) 8 | -------------------------------------------------------------------------------- /modify Edge Link/modify Edge Link.ps1: -------------------------------------------------------------------------------- 1 | # Script to modify a .lnk file 2 | # www.IntheCloud247.com 3 | #modify variables accordingly 4 | $fileName ="Microsoft Edge.lnk" 5 | $folder = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs" 6 | $list = Get-ChildItem -Path $folder -Filter $fileName -Recurse | Where-Object { $_.Attributes -ne "Directory"} | select -ExpandProperty FullName 7 | $obj = New-Object -ComObject WScript.Shell 8 | 9 | ForEach($lnk in $list) 10 | { 11 | $obj = New-Object -ComObject WScript.Shell 12 | $link = $obj.CreateShortcut($lnk) 13 | [string]$path = $link.TargetPath 14 | $link.Arguments = "--start-fullscreen" 15 | $link.TargetPath = [string]$path 16 | $link.Save() 17 | } 18 | --------------------------------------------------------------------------------