Le blog technique

Toutes les astuces #tech des collaborateurs de PI Services.

#openblogPI

Retrouvez les articles à la une

Intune : Désactiver le webmail dans Adobe Acrobat Reader

Par mesure de sécurité, il est conseillé de désactiver le « Webmail » dans Adobe Acrobat Reader.

Ceci est possible en utilisant un script de remédiation dans Intune.

Script de détection :

$regkey64 = "HKLM:\SOFTWARE\Policies\Adobe\Adobe Acrobat\DC\FeatureLockDown\cWebmailProfiles"
$regkey32 = "HKLM:\SOFTWARE\Policies\Adobe\Acrobat Reader\DC\FeatureLockDown\cWebmailProfiles"
$name = "bDisableWebmail"
    try
    {
        $exists64 = Get-ItemProperty $regkey64 $name -ErrorAction SilentlyContinue
        $exists32 = Get-ItemProperty $regkey32 $name -ErrorAction SilentlyContinue
        #Write-Host "Test-RegistryValue: $exists"
        if ((($exists64 -eq $null) -and ($exists32 -eq $null)) -or (($exists64.bDisableWebmail -ne 1) -and ($exists32.bDisableWebmail -ne 1)))
        {
            Write-Host "Webmail enabled"
            exit 1
        }
        else
        {
            Write-Host "Webmail disabled"
            exit 0
        }
    }
    catch
    {
        return $false
    }

Script de remédiation :

$regkey64 = "HKLM:\SOFTWARE\Policies\Adobe\Adobe Acrobat\DC\FeatureLockDown\cWebmailProfiles"
$regkey32 = "HKLM:\SOFTWARE\Policies\Adobe\Acrobat Reader\DC\FeatureLockDown\cWebmailProfiles"
$name = "bDisableWebmail"
New-item -Path $regkey64 -ErrorAction SilentlyContinue
New-item -Path $regkey32 -ErrorAction SilentlyContinue
New-ItemProperty -Path $regkey64 -Name $name -Value "1"  -PropertyType "DWORD" -Force -ErrorAction SilentlyContinue
New-ItemProperty -Path $regkey32 -Name $name -Value "1"  -PropertyType "DWORD" -Force -ErrorAction SilentlyContinue

 

Intune – Détecter l’installation et l’utilisation du New Teams

Avec l’arrivée du New Teams, les IT ont besoin d’inventorier les appareils Windows qui l’ont installé et qui l’utilisent.

Ceci est possible en utilisant un script de remédiation Intune, qui fera le check continu sur tous les appareils concernés.

Script de détection :

function Is-NewTeamsInstalled {
    return (Get-AppxPackage *MSTeams* -ErrorAction SilentlyContinue) -ne $null
}
 
# Function to check if Microsoft Teams is the default IM app
function Is-NewTeamsDefault {
    $registryPath = "HKCU:\Software\IM Providers"
    $registryKey = "DefaultIMApp"
    $defaultValue = Get-ItemProperty -Path $registryPath -Name $registryKey -ErrorAction SilentlyContinue
 
    return ($defaultValue -ne $null) -and ($defaultValue.DefaultIMApp -eq "MSTeams")
}
 
# Main script logic
$teamsInstalled = Is-NewTeamsInstalled
$teamsDefault = Is-NewTeamsDefault
 
if ($teamsInstalled -and $teamsDefault) {
    Write-Host "New Teams installed and is set Default!";Exit 0
} 
elseif ($teamsInstalled -or $teamsDefault) {
    Write-Host "New Teams installed but not set Default."
    Exit 1
}
else {
    Write-Host "New Teams not installed."
    Exit 1
}

 

Intune : Définir le fuseau horaire automatiquement dans Windows 10/11

Afin de détecter les appareils Windows où l’option « Définir le fuseau horaire automatiquement » est désactivée, il suffit d’utiliser un script de remédiation Intune.

Script de détection :

$registrySettings = @(
    @{ Path = "HKLM:\SYSTEM\CurrentControlSet\Services\tzautoupdate"; Name = "Start"; DesiredValue = 3 }
)


    # test if the registry path exists
    if ((Test-Path $registrySettings.Path)) {

        # get the current value of the registry key
      
        $currentValueTZauto = (Get-ItemProperty -Path $registrySettings.Path -ErrorAction SilentlyContinue).$($registrySettings.Name)
  

        # If the current value is not the desired value, update it
        if ($currentValueTZauto -ne $registrySettings.DesiredValue) {
            Write-Host "the current value is Start=$currentValueTZauto, and it is not the desired value"
			exit 1
        } else {
            # If the current value is already correct, do nothing
            Write-Host "the current value is Start=$currentValueTZauto, and it is the desired value"
			exit 0
        }

    } else {
        # If the registry path does not exist, log a warning
        Write-Warning "Registry path $($registrySettings.Path) does not exist."
		exit 1
    }