Intune Initial Scripts Backup

This commit is contained in:
2025-04-21 14:21:38 -04:00
commit 71764cd10f
241 changed files with 28218 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
Import-Module ActiveDirectory
Import-Module WindowsUpdate
$ServerList = Import-Csv 'C:\Users\abamaso-ccxadmin\Desktop\CompletedProd_WindowsServers - Classifications.csv'
$AllServers = @()
foreach ($Server in $ServerList) {
$patchingtier = $Server.Classification
$ServerObject = New-Object psobject
$ComputerValidation = $null
$WSUSComputerObject = Get-WsusServer -Name psus002 -PortNumber 8530|Get-WsusComputer -NameIncludes $server.'Server Name'
$ComputerValidation = $wsuscomputerobject.FullDomainName
$ServerObject | Add-Member -MemberType NoteProperty -Name "Server Name" -Value $server.'Server Name'
$ServerObject | Add-Member -MemberType NoteProperty -Name "Operating System" -Value $server.'Operating System'
$ServerObject | Add-Member -MemberType NoteProperty -Name "Application" -Value $server.Application
if ($ComputerValidation -eq $null) {
$ServerObject | Add-Member -MemberType NoteProperty -Name "WSUS Status" -Value "Server is not in WSUS"
}
else {
$ServerObject | Add-Member -MemberType NoteProperty -Name "WSUS Status" -Value "Server is in WSUS"
}
$AllServers +=$ServerObject
Write-host $Server.'Server Name'" checked in WSUS"
}
$AllServers | export-csv C:\Users\abamaso-ccxadmin\Desktop\WSUSComputers.csv