Delete IIS Logs Automatically
On web servers, and Exchange OWA servers especially, there are a lot of OWA logs which can be found in C:\inetpub\logs\LogFiles\W3SVC1.
On web servers, and Exchange OWA servers especially, there are a lot of OWA logs which can be found in C:\inetpub\logs\LogFiles\W3SVC1.
This is a very manual task of logging onto each domain controller and copying the file to a central location, and then sifting through the data to remove any duplicate IP addresses etc. This task becomes very time consuming if you have a large number of domain controllers.
Here is a quick little one liner to find all the deferred messages with FromAddress, Recipients and DeferReason. Get-TransportServer | Get-Queue | ?{$_.Identity -like ‘*submission*’} | get-message -IncludeRecipientInfo | ?{$_.Status -eq ‘Retry’} | select FromAddress,Recipients, DeferReason
Makes the initials characters capital. ie. character after space/hyphen/dot Public Function MakeInitialsCapital(str As String) As String Dim i As Integer, L As Integer Dim Prev_char As String * 1 Dim c As String * 1 Dim S As String Prev_char = ” ” L = Len(str) i = 1 S = “” Do While i <= L c = Mid(str, i, 1) If Prev_char = ” “… Read More »
Generating a password with PowerShell is relatively easy if you leverage a particular method of .Net, System.Web.Security.Membership. Add-Type -AssemblyName System.Web[System.Web.Security.Membership]::GeneratePassword(8,2) Simple and to the point. But below is a pretty good function to do something similar, if you are curious about string operations with PowerShell. function Get-RandomPassword($length){ $length-=1 $lower = ‘abcdefghijklmnopqrstuvwxyz’ $upper = $lower.ToUpper() $number = 0..9 $special=’~!@#$%^&*()_+|}{[]\’ $chars = “$lower$special$upper”.ToCharArray() $pass = Get-Random -InputObject… Read More »
Finding machines in Active Directory is pretty easy using the Get-ADComputer commandlet. You can specify what to find by any number of parameters. For example, the most basic use of the commandlet is: Get-ADComputer -Filter * The above code will return all Active Directory computer objects. But lets say you are in the process of upgrading operating systems across the domain, and… Read More »
This page contains the version history of SystemIdleCheck. Each entry explains what items were add/changed/removed for that particular release.
SystemIdleCheck is very straightforward to use. The current version switches are show below. All switches are case sensitive, but the value of the switch is not. All switches have default values, and can appear in any order on the command line. Switches Switch Name Description T TimeOut Sets the number of seconds the system should be idle for.… Read More »
Just a quick PowerShell one-liner to display all the shutdown events on a computer.
In case anyone is curious, this is a list of APIs that are being used. Note that the event logging functionality is still in progress, but the API references are in place in the code.