Intune Initial Scripts Backup
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
$Path = "HKLM:\SYSTEM\CurrentControlSet\services\NetBT\Parameters\Interfaces\tcpip*"
|
||||
$Name = "NetbiosOptions"
|
||||
$Type = "DWORD"
|
||||
$Value = 2
|
||||
|
||||
Set-ItemProperty -Path $Path -Name $Name -Type $Type -Value $Value
|
||||
@@ -0,0 +1,34 @@
|
||||
$Path = "HKLM:\SYSTEM\CurrentControlSet\services\NetBT\Parameters\Interfaces\tcpip*"
|
||||
$Name = "NetbiosOptions"
|
||||
$Type = "DWORD"
|
||||
$Value = 2
|
||||
|
||||
Try {
|
||||
$Registry = Get-ItemProperty -Path $Path -Name $Name -ErrorAction Stop | Select-Object -ExpandProperty $Name
|
||||
$Counter = 0
|
||||
Foreach ($Entry in $Registry )
|
||||
{
|
||||
If ($Entry -eq $Value)
|
||||
{
|
||||
$Counter+=0
|
||||
}
|
||||
else
|
||||
{
|
||||
$Counter+=1
|
||||
}
|
||||
}
|
||||
if($Counter -eq 0)
|
||||
{
|
||||
Write-Output "Compliant"
|
||||
Exit 0
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Warning "Not Compliant"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
Catch {
|
||||
Write-Warning "Not Compliant"
|
||||
Exit 1
|
||||
}
|
||||
Reference in New Issue
Block a user