While helping a peer at a Junior College clean up a their Active Directory I wrote this one liner to set the Display Name field uniformly for all of their accounts. It just takes every AD account with a specific UPN and sets display name to Last, First for each user based on what they already have in AD for Given Name and Surname.
Category Archives: Windows
PowerShell, Write log and email
One of the key components to many of my scripts is to have it produce either a transcript or CSV or both and send out an email with that attached. You can take and modify this code to make files for input into a Database or to simply send out a “I ran a script” email.
Block petya virus on a computer
Yesterday news started to break about a new virus making the rounds. Initially it was being referred to as ransom-ware but the email address to get a recovery key after paying has been blocked and researchers have now discovered that the HD is in fact not encrypted but the MBR destroyed and there is no recovery (Link to more information about that here). There are also several sources speculating that this was a Nation State attack masked as a ransom-ware, Wired Magazine wrote this about the virus and possible ties to Russia. There appears to be a way to “inoculate” your computer to block the virus from infecting you and that is what this will show.