Skip to content

Instantly share code, notes, and snippets.

View tckz's full-sized avatar
🌵

tckz

🌵
View GitHub Profile
@tckz
tckz / report_wsus.ps1
Created June 24, 2009 06:28
Report wsus computer targets which is important updates have not been installed yet.
param([switch]$nomail)
trap [Exception] {
$t = $error[0].ToString().Trim() + "`n" + $error[0].InvocationInfo.PositionMessage.Trim()
[Diagnostics.EventLog]::WriteEntry("report_wsus", $t, "Error", 1)
}
[reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | out-null
$update_server = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer()
$update_server.PreferredCulture ="ja"
@tckz
tckz / ifdown-up.ps1
Created June 24, 2009 06:20
ifdown/up for windows
$sh = New-Object -ComObject Shell.Application
$nc = $sh.NameSpace(3).Items() | ? { $_.Name -eq "ネットワーク接続" }
$lan = $nc.GetFolder.Items() | ? { $_.Name -eq "ローカル エリア接続" }
$disable = $lan.Verbs() | ? { $_.Name -eq "無効にする(&B)" }
if($disable)
{
write-host "disabling."
$disable.DoIt()
}
@tckz
tckz / backup.sh
Created March 26, 2009 04:15
backup
#!/bin/sh
dir_backup_dst=/path/to/backup/`hostname`
timestamp=`date +%Y%m%d%H`
myname=`basename $0`
pid=$$
(