Category Archives: Windows

MS Windows or PC related

RSAT

I kept ending up switching primary work computers, changing domains with different policies, WU servers, etc and it seems that installing RSAT ended up using different method to install on occasion. Here’s what I ended up using that just plain works (so long as you have admin rights).

Continue reading RSAT

Domain password expiration list

A quick powershell way to list expiring user passwords from a specific ou. Change for your ou structure of course:


Get-ADUser -SearchBase "OU=Users,OU=OREU1-Eugene,OU=Properties,DC=mydomain,DC=net" -filter {Enabled -eq $True -and PasswordNeverExpires -eq $False} –Properties "DisplayName", "msDS-UserPasswordExpiryTimeComputed" | Select-Object -Property "Displayname",@{Name="ExpiryDate";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}} | Export-Csv UserPassExpires.csv

Simple email notification when server reboots

Often overlooked is the ability to schedule a task to run at system start.  Utilizing that, you can use any number of ways to craft and send an email upon system reboot.

You can Google for a list of free smtp command line mailers to send the email or just use Blat which I’ve used for a while and works just fine.

Here’s a sample blat cmdline which can be added to a batch script or used directly in the task scheduler.

c:\utils\blat.exe -to recipient@mydomain.com -f Sender@mydomain.com -server smtp.mydomain.com -subject "Server Reboot" -body "%computername% has been rebooted."

If you want to use a mailer that’s a little more robust & includes CC,BCC, and support for SSL/TLS (can be used with gmail) and other little things, check out Send-It-Quiet (src/bin avail via Github). And a 3rd option that also supports TLS is sendEmail.

The key is to simply use task scheduler…there are quite a few delivery methods and scripts including using Powershell like this person has.