Ping -t 8.8.8.8 | ForEach {"{0} - {1}" -f (Get-Date),$_}

Ping -t 8.8.8.8 | ForEach {"{0} - {1}" -f (Get-Date),$_}
$Clustername = "The_Cluster" Set-Alias Start-PowerShell64 "$env:windir\sysnative\WindowsPowerShell\v1.0\powershell.exe" # Create run string, to be able to parse argument $runThis = "Start-PowerShell64 {Get-ClusterNode -Cluster " + $Clustername + "}" $Outdata = Invoke-Expression $runThis
if($teststring -match "^\d+$") { Write-host "It's a number" }
$allDCs = (Get-ADForest).Domains | %{ Get-ADDomainController -Filter * -Server $_ }
Add-WindowsFeature -Name "RSAT-AD-PowerShell" –IncludeAllSubFeature
$Session = New-Object -ComObject Microsoft.Update.Session $Searcher = $Session.CreateUpdateSearcher() $Searcher.Search("IsInstalled=1").Updates | sort LastDeploymentChangeTime | ft -a LastDeploymentChangeTime, title
$AllProtocols = [System.Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12' [System.Net.ServicePointManager]::SecurityProtocol = $AllProtocols [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} $webClient = New-Object System.Net.WebClient $content = $webClient.DownloadString('http://www.server1.dk') $content
$users = quser foreach ( $user in $users) { if ($user -like"*Disc*") { logoff $user.substring(40,6).Trim() } }
function Test-Port($hostname, $port) { # This works no matter in which form we get $host - hostname or ip address try { $ip = [System.Net.Dns]::GetHostAddresses($hostname) | select-object IPAddressToString -expandproperty IPAddressToString if($ip.GetType().Name -eq "Object[]") { #If we have several ip's for that address, let's take first one $ip = $ip[0] } } catch { Write-Host "Possibly $hostname is wrong hostname or IP" return } $t = New-Object Net.Sockets.TcpClient # We use Try\Catch to remove exception info from console if we can't connect try { $t.Connect($ip,$port) } catch {} if($t.Connected) { $t.Close() $true } else { $false } }
$ADgroup = "testgroup" Get-ADGroupMember $ADgroup | ForEach-Object {Remove-ADGroupMember $ADgroup $_ -Confirm:$false}