Intune Initial Scripts Backup
This commit is contained in:
19
dump/WSUS_Scripts/Old-Scripts/NewSorting.ps1
Normal file
19
dump/WSUS_Scripts/Old-Scripts/NewSorting.ps1
Normal file
@@ -0,0 +1,19 @@
|
||||
Import-Module ActiveDirectory
|
||||
Import-Module WindowsUpdate
|
||||
|
||||
|
||||
$ServerList = Import-Csv 'C:\Users\abamaso-ccxadmin\Desktop\CompletedProd_WindowsServers - Classifications.csv'
|
||||
|
||||
|
||||
foreach ($Server in $ServerList) {
|
||||
$patchingtier = $Server.Classification
|
||||
|
||||
switch ($patchingtier){
|
||||
|
||||
"Tier0 - Infrastructure" {Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server.'Server Name'| Add-WsusComputer -TargetGroupName "Tier0 - Infrastructure"}
|
||||
"Tier1 - Critical Infrastructure" {Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server.'Server Name'| Add-WsusComputer -TargetGroupName "Tier1 - Critical Infrastructure"}
|
||||
"Tier2 - File Servers" {Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server.'Server Name'| Add-WsusComputer -TargetGroupName "Tier2 - File Servers"}
|
||||
"Tier2 - Application Servers" {Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server.'Server Name'| Add-WsusComputer -TargetGroupName "Tier2 - Application Servers"}
|
||||
}
|
||||
Write-host $Server.'Server Name'" Sorted into Group"
|
||||
}
|
||||
Reference in New Issue
Block a user