Posts

Monitoring a Windows service with Powershell

Image
Monitor Windows Service with Powershell Description This script is used to monitor a Windows service. If the monitored service is not active, the script will try to restart it.  15 seconds later, it checks its status again, if the service is still stopped, it retrieves the generated logs and sends an alert email. Github link Then simply place the script in a scheduled task and run it regularly. #Function create Log folder     Function CreateLogsFolder {     If (!( Test-Path C:\Logs))     {     New-Item -Force -Path "C:\Logs\" -ItemType Directory } else {     Write-Host "Le dossier " C:\Logs\ " existe déjà !"     } } #Create Log Folder     CreateLogsFolder #Declaration of script variables     $Client = "ClientName"     $Server = (Get-CimInstance -ClassName Win32_ComputerSystem).Name     $Date = Get-Date     $ServiceName = "XboxGipSvc"     $Log...

Repartition your hard drive with Powershell

Image
This script removes a secondary partition from a disk and then extends the primary partition. This script can be used in the Inplace updrade task sequence. Github link : https://github.com/ChrisMogis/Scripts/blob/main/ReconfigureDisk.ps1

Configure Google Chrome with Microsoft Intune

Image
With the arrival of Microsoft Intune release 2203 , Microsoft is providing us with new administrative templates for Google Chrome so that MEM administrators can manage Google browser settings. Source :  What's new in Microsoft Intune | Microsoft Docs Let's take a look at how to use Google Chrome Administrative Templates in Microsoft Intune. Create a configuration profile To do this, go to the Microsoft Intune console  https://endpoint.microsoft.com/  then perform the following actions: Go to Devices  / Windows / Configuration Profiles  and select option Create profile Choose the following options for create your profile   : Windows 10 and later Templates Administrative Templates Then click on the button Create Then complete the Name and designation fields and click on Next Sélect  Google Select  Google Chrome and Google Chrome Select the options you want to apply to user's workstations. In my case, I put the Bing url as the homepage and added...

Intune - Deployer Dot Net Framework 3.5

Image
1. Script d'installation Param ( [Parameter(Mandatory= $true )] [ValidateSet( "Install" , "Uninstall" )] [String[]] $Choose ) If ( $Choose -eq "Install" ) { DISM /Online /Enable-Feature /FeatureName:NetFx3 /All } If   ( $Choose -eq "Uninstall" ) { Disable-WindowsOptionalFeature -Online -FeatureName 'NetFx3' -Remove -NoRestart } Script PowerShell disponible ici :   https://github.com/ChrisMogis/Scripts/blob/main/Install_DotNet35.ps1 2. Conversion du package au format .intunewin L'intégration du script Powershell dans Microsoft Intune nécessite que celui-ci soit au préalable converti au format .intunewin .  Procédure complète disponible ici :   https://www.ccmtune.fr/2022/01/intune-creer-un-package-intunewin.html Lancer l'utilitaire  IntuneWinAppUtil.exe Spécifier  le chemin qui contient les sources  puis  appuyer sur Entrée Entrer le nom de l’exécutable , ici c'est notre script PowerShell puis appuyer sur Entrée Indique...