This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
[String]$file | |
) | |
function check ([String]$ipadress) { | |
#param ($ipadress) | |
$ipadress -match "(\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b)" | |
} | |
if ($file -ne "") { | |
$dir = Get-Location |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$rechnerliste = (("NAS",192,168,178,1),("Desktop PC1",192,168,178,19),("Desktop PC2",192,168,178,22),("Drucker",192,168,118,22),("WebServer",192,168,118,9),("Fileserver",192,168,118,56)) | |
$sub1= Read-Host ("1. Oktett Subnetzmaske") | |
$sub2=Read-Host ("2. Oktett Subnetzmaske") | |
$sub3=Read-Host ("3. Oktett Subnetzmaske") | |
$sub4=Read-Host ("4. Oktett Subnetzmaske") | |
$n1=$rechnerliste[0][1] -band $sub1 | |
$n2=$rechnerliste[0][2] -band $sub2 | |
$n3=$rechnerliste[0][3] -band $sub3 | |
$n4=$rechnerliste[0][4] -band $sub4 | |
Write-Host ("Netz Adresse von "+$rechnerliste[0][0]+" ist $n1.$n2.$n3.$n4") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$port=2021 | |
$endpoint = new-object System.Net.IPEndPoint ([IPAddress]"10.13.6.100",$port) | |
$udpclient=new-Object System.Net.Sockets.UdpClient | |
$b=[Text.Encoding]::ASCII.GetBytes('Is anyone there!') | |
$bytesSent=$udpclient.Send($b,$b.length,$endpoint) | |
$udpclient.Close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param([String]$ips,[String]$subs) | |
$sub=$subs.Split(".") # Array Oktette der Subnezmaske | |
$ip=$ips.Split(".") # Array Oktelle der Netzip | |
# Netz IP bestimmen | |
$netz=0,0,0,0 | |
for ($i=0; $i -lt 4;$i++) { | |
$netz[$i]=$ip[$i] -band $sub[$i] | |
} | |
$imSubnetz=$true | |
$aktuelleIP=0,0,0,0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$hmax = read-host Maximale Länge für Hypothenuse eingeben!; | |
for ($j=1; $j -le $hmax; $j++){ | |
for ($k=1; $k -lt $j; $k++){ | |
$h= [math]::Sqrt(($j * $j)+($k * $k)); | |
if ($h % 1.0 -eq 0.0 -and $h -le $hmax){ | |
write-host $h + $j + $k; | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do { | |
[int32]$zstart = read-host "Startzahl" | |
} while (($zstart % 2) -eq 0) | |
do { | |
[int32]$zende = read-host "Endezahl" | |
} while (($zende % 2) -eq 0) | |
[int32]$summe = 0 | |
for ($i=$zstart+2;$i -le $zende -2;$i+=2) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Login | |
Invoke-WebRequest "http://192.168.178.29/mmbbsapp/news.php?user=mmbbs&password=mmbbs" -SessionVariable s | |
# Logout | |
Invoke-WebRequest "http://192.168.178.29/mmbbsapp/news.php?cmd=logout" -WebSession $s | |
# Abfrage letzte News | |
Invoke-WebRequest http://192.168.178.29/mmbbsapp/news.php -WebSession $s | |
# Abfragen News ab ID | |
Invoke-WebRequest http://192.168.178.29/mmbbsapp/news.php?id=2 -WebSession $s | |
# Eintragen einer News | |
Invoke-WebRequest "http://192.168.178.29/mmbbsapp/news.php?Headline=Überschrift&Text=Dies ist ein Text mit öäü" -WebSession $s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ipinfo($ip) { | |
$ip | |
[int[]]$x = $ip.Split(".") | |
if($x[0] -le 127) | |
{ | |
"Class A" | |
} | |
elseif($x[0] -gt 127 -and $x[0] -le 191) | |
{ | |
"Class B" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ci=New-Object System.Object | Select-Object -Property MACAddress,Architecture,OS,RAM,freeDiskspace,ComputerName | |
$ci.MACAddress=Get-WmiObject win32_networkadapterconfiguration | Where-Object ipaddress | Select-Object -ExpandProperty MACAddress | |
$ci.Architecture=(Get-WmiObject win32_operatingsystem).OSArchitecture | |
$ci.OS=(Get-WmiObject win32_operatingsystem).Caption | |
[double]$ci.RAM=(Get-WmiObject win32_computersystem).totalPhysicalmemory/1gb | |
$ci.freeDiskspace=(Get-WmiObject win32_logicaldisk) | Where-Object {$_.DeviceID -eq "c:"} | Select-Object -ExpandProperty FreeSpace | |
$ci.ComputerName=$env:COMPUTERNAME | |
$ci |