Intune Initial Scripts Backup
This commit is contained in:
26
dump/SCCM-Tool/test1.ps1
Normal file
26
dump/SCCM-Tool/test1.ps1
Normal file
@@ -0,0 +1,26 @@
|
||||
$NotResponding = @()
|
||||
$Ping_Result = @()
|
||||
$Script:DeviceCollection_ServerNames1.Name | % {
|
||||
$Server = $_
|
||||
$Obj = New-Object -TypeName PSObject
|
||||
|
||||
If (Test-Connection $Server -Count 1 -ErrorAction SilentlyContinue ) {
|
||||
#Write-Host "Responding:---- $_ " -ForegroundColor Green
|
||||
#$Script:Output.AppendText("Responding: $_")
|
||||
|
||||
$Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server
|
||||
$Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "Yes"
|
||||
$Ping_Result += $Obj
|
||||
|
||||
}#endIf
|
||||
|
||||
Else {
|
||||
|
||||
$NotResponding += $Server
|
||||
$Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server
|
||||
$Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!"
|
||||
$Ping_Result += $Obj
|
||||
}
|
||||
}#end%
|
||||
$Ping_Result
|
||||
$NotResponding
|
||||
Reference in New Issue
Block a user