PowerShell Remoting
Enable Enable-PSRemoting Set-WSManQuickConfig winrm quickconfig Disable Disable-PSRemoting *Note* You will need to disable some configurations yourself. Create New-PSSession -ComputerName localhost -Credential(Get-Credential) Enter Enter-PSSession examplecomputername...
C Drive Free Space To HTML File
$html = @' <!DOCTYPE html PUBLIC> <html> <head> <style>BODY{{background-color:white;}}TABLE{{border-width: 2px;border-style: solid;border-color: black;border-collapse: separate;width:800px}}TH{{border-width: 1px;padding: 0px;border-style: solid;border -color: black;background-color:lightblue}}TD{{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:White}}</style> </head><body> <table> <colgroup><col/><col/><col/><col/><col/></colgroup>...
Compare Two Directories
$refdirvar = Get-ChildItem -Recurse -path C:\test $diffdirvar = Get-ChildItem -Recurse -path C:\test\home Compare-Object -ReferenceObject $refdirvar -DifferenceObject $diffdirvar *Note* Input object is the difference object....
Check Active Directory From File
$names = Get-content "C:\list.txt" $file = '\\share\inad.txt' while ((Test-Path $file)) { $file = $file.Replace(".txt", "_.txt") } foreach ($name in $names) { $Addresses = $null try...
Nslookup Computers From File
$names = Get-content "C:\list.txt" $file = '\\share\nslook.txt' while ((Test-Path $file)) { $file = $file.Replace(".txt", "_.txt") } foreach($name in $names) { $Addresses = $null $Addresses =...
Ping Computers From File
$names = Get-content "C:\list.txt" $file = '\\share\pingable.txt' while ((Test-Path $file)) { $file = $file.Replace(".txt", "_.txt") } foreach($name in $names) { if(Test-Connection -ComputerName $name -Count 1...
Get Computer HDD Size
Get-PSDrive C | Select-Object Used,Free...