PowerShell: $ou = [adsi]”LDAP://OU=Marketing,OU=Departments,DC=Company,DC=Domain”; $user = $ou.psbase.get_children().find(‘CN=UserName’); $user.psbase.invokeSet(“allowLogon”,0); $user.setinfo(); Bash: #!/bin/bash fname=”/path/file” tname=”/new/file.tmp” i=”0″ DATE=$(date +%Y%m%d%H%M%S) sudo cp “$fname” “$fname”.$DATE while IFS=” read -r line […]
Continue readingCategory: Windows
Windows
SQL Query for Recently Changed Objects
These may be useful to determine when objects have been changed. We might infer from this info when was the last formal deployment of a […]
Continue readingFix an SQL Database Marked Suspect
If you have a database marked suspect, and do not have a backup to restore from, you can attempt to repair the database. This may […]
Continue readingPurge Backup History from SQL msdb Database
I just about ran out of space on my Data partition and discovered that the msdb database was over 114 GB! In particular, the backupfile […]
Continue readingClear Orchestrator Logs from Runbooks by Folder Name
I found it useful to clear Orchestrator Runbook logs by Folder. This allowed me to clear smaller chunks of logs from Orchestrator where in the […]
Continue readingQuery for the Size of All Databases in SQL
If you need to see the size of all databases on an SQL server, here is a helpful query, one I always seem to need […]
Continue readingNo Connection!! Clear Your ARP Table
A great article! This is rare, but sometimes you need to know: http://zeldor.biz/2011/09/clear-arp-cache/
Continue readingSQL 2008 R2: Cannot Bring Database Back Online
I had a terribly stressful evening at work last night. I brought a database offline to move a file and when I tried to bring […]
Continue readingGet All Installed Software Using PowerShell
The following PowerShell script will return all installed software on a Windows server. function GetInstalledMSIVersionNumber($MSIName) { #Define the variable to hold the location of Currently […]
Continue readingCollect Logs from a SAN Switch using Putty
How to collect logs from an EMC SAN Switch for debugging networking issues. The following worked successfully on a Connectrix 300 Brocade switch using PuTTY […]
Continue reading