Intune Initial Scripts Backup
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
$null = $AdapterBandPreference
|
||||
$Adapter = "Wi-Fi"
|
||||
$AdapterProperty = "Preferred Band"
|
||||
$DisplayValue = "2. Prefer 2.4GHz band"
|
||||
|
||||
Try {
|
||||
$AdapterBandPreference = Get-NetAdapterAdvancedProperty -Name $Adapter -DisplayName $AdapterProperty
|
||||
If ($AdapterBandPreference.DisplayValue -eq $DisplayValue){
|
||||
Write-Output "Compliant"
|
||||
Exit 0
|
||||
}
|
||||
Write-Warning "Not Compliant"
|
||||
Exit 1
|
||||
}
|
||||
Catch {
|
||||
Write-Warning "Not Compliant"
|
||||
Exit 1
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
$null = $AdapterBandPreference
|
||||
$Adapter = "Wi-Fi"
|
||||
$AdapterProperty = "Preferred Band"
|
||||
$DisplayValue = "2. Prefer 2.4GHz band"
|
||||
|
||||
Try {
|
||||
Set-NetAdapterAdvancedProperty -Name $Adapter -DisplayName $AdapterProperty -DisplayValue $DisplayValue
|
||||
$AdapterBandPreference = Get-NetAdapterAdvancedProperty -Name $Adapter -DisplayName $AdapterProperty
|
||||
If ($AdapterBandPreference.DisplayValue -eq $DisplayValue){
|
||||
Write-Output "Compliant"
|
||||
Exit 0
|
||||
}
|
||||
Write-Warning "Not Compliant"
|
||||
Exit 1
|
||||
}
|
||||
Catch {
|
||||
Write-Warning "Not Compliant"
|
||||
Exit 1
|
||||
}
|
||||
Reference in New Issue
Block a user