How Long Until My Password Expires?
Domain Password Report
Saturday, February 14, 2009
Wednesday, February 11, 2009
count events
function CountEvents{
BEGIN {
$errors = 0
$warnings = 0
$info = 0
}
PROCESS {
switch -wildcard ($_.entrytype) {
"err*" {$errors++}
"warn*" {$warnings++}
"info*" {$info++}
default {}
}#switch block
}#process block
END {
"The System log contains " + $errors + " error messages."
"The System log contains " + $warnings + " warning messages."
"The System log contains " + $info + " information messages."
}#end block
}#function block
#get-eventlog "System" -newest 100 CountEvents
======================= anothe approach ==============
$events = get-eventlog "System" -newest 100
function CountEvents{
$count = 0
foreach ($event in $args[0]) {
if ($event.entrytype -like $args[1]) {$count++}
}#foreach block
return $count
}#function block
$errors = CountEvents $events "err*"
$warnings = CountEvents $events "warn*"
$info = CountEvents $events "info*"
"The System log contains " + $errors + " error messages."
"The System log contains " + $warnings + " warning .messages."
"The System log contains " + $info + " information messages."
BEGIN {
$errors = 0
$warnings = 0
$info = 0
}
PROCESS {
switch -wildcard ($_.entrytype) {
"err*" {$errors++}
"warn*" {$warnings++}
"info*" {$info++}
default {}
}#switch block
}#process block
END {
"The System log contains " + $errors + " error messages."
"The System log contains " + $warnings + " warning messages."
"The System log contains " + $info + " information messages."
}#end block
}#function block
#get-eventlog "System" -newest 100 CountEvents
======================= anothe approach ==============
$events = get-eventlog "System" -newest 100
function CountEvents{
$count = 0
foreach ($event in $args[0]) {
if ($event.entrytype -like $args[1]) {$count++}
}#foreach block
return $count
}#function block
$errors = CountEvents $events "err*"
$warnings = CountEvents $events "warn*"
$info = CountEvents $events "info*"
"The System log contains " + $errors + " error messages."
"The System log contains " + $warnings + " warning .messages."
"The System log contains " + $info + " information messages."
Tuesday, February 10, 2009
Pinging a Server from a Server you are not logged in to
Pinging a Server from a Server you are not logged in to
So if you wanted server remote1 to ping server remote3 you could do something like this:
Get-WmiObject Win32_pingstatus –filter “Address =’remote3’” –computername remote1.| statuscode,address,_server
So if you wanted server remote1 to ping server remote3 you could do something like this:
Get-WmiObject Win32_pingstatus –filter “Address =’remote3’” –computername remote1.| statuscode,address,_server
Wednesday, February 4, 2009
PowerShell Scriptomatic V1.0
Another Pre-Memorial bonus for PowerShell fans is that Windows PowerShell Scriptomatic V1.0 now avaliable and you can download it Here
create AD accts & exchange 2003 mail boxes links
Enterprise Powershell: Creating Mailboxes in Exchange 2003
Find all mailboxes with quota limit is NOT set to default. & more
Creating new AD user accounts from a csv-file data has become even easier
Manage Exchange Server 2003 Using Windows PowerShell and WMI
More About Using PowerShell to Manage Exchange Server 2003
PowerShell Tutorial 12 - Part 1: Active Directory Management
WMI PowerShell for Exchange 2003
How to write a LDAP search filter
Searching Active Directory with Windows PowerShell
Objective 2 - QAD Script to Change Passwords
http://mow001.blogspot.com/2005/12/g...able-from.htmlhttp://mow001.blogspot.com/2006/03/w...-part-one.htmlgr /\/\o\/\/
Find all mailboxes with quota limit is NOT set to default. & more
Creating new AD user accounts from a csv-file data has become even easier
Manage Exchange Server 2003 Using Windows PowerShell and WMI
More About Using PowerShell to Manage Exchange Server 2003
PowerShell Tutorial 12 - Part 1: Active Directory Management
WMI PowerShell for Exchange 2003
How to write a LDAP search filter
Searching Active Directory with Windows PowerShell
Objective 2 - QAD Script to Change Passwords
http://mow001.blogspot.com/2005/12/g...able-from.htmlhttp://mow001.blogspot.com/2006/03/w...-part-one.htmlgr /\/\o\/\/
Subscribe to:
Posts (Atom)