Making Sure Only Your PDC is Scavanging DNS Records

I recently looked over out DNS server settings, and I found out that more than one DNS server (DC in our case) was scavenging records.
In order to put that right, I made a small script that makes sure that only the PDC is scavenging records:

param(
 $scavengeInterval = 7
)

Get-ADDomainController …
more ...

Brute Force Guessing for User Passwords

Our security team complained to me that they found a lot of users with trivial passwords simply by trying to log in as them.
They asked me to write them a script to speed up the process, so I wrote them my brute force guessing script.
It's not very stealthy …

more ...

Automaticlly Updating DNS Server Addresses In A Domain Machine

The Problem

I was recently requested to make sure that our machine's network interface cards (NICs) have their DNS queries pointed to "the correct servers".
I decided that every machine should point to its domain's DNS servers, and it's their job to redirect queries (if needed) to other DNS servers …

more ...

Applying SPWebConfigModification objects safely

My SharePoint team and I wanted to move to SPWebConfigModification rather that just modifying the web.config file manually, but I was always worried that applying faulty modifications will ruin my file.
Why?

How SPWebConfigModification objects work

Some code requires you to modify the SharePoint web application's web.config file …

more ...

Updating VMware discovery info in Active Directory

Recently I decided I want to store physical discovery data (name, physical location, host if it's a VM) on the machine's account in Active Directory, because we have a lot of machines and during a crisis we sometimes forget where they are.
I started with our VMware infrastructure, and decided …

more ...

Installing WSUS Prerequisites Easily in a Disconnected Server

Our company has an internet-isolated environment, and I was requested to create a WSUS infrastructure there.
The most annoying thing about installing a disconnected WSUS server is that you can't do it via the server manager (because it requires a working internet connection) but rather through an exe file, and …

more ...

Automaticlly Extracting Downloaded Torrents

As every average geek, I too download torrents (containing only legal, copyright-free material, of course), and most of the time the torrents contain multi-file archives that contain the really juicy data.
A lot of times I return home and find some new torrent has completed downloading, but I have to …

more ...

Determining Size of all Tables in a Database

Just a quick SQL script to get the rowcount and size data of every table in the current database:

CREATE TABLE #sizeof (
 name varchar (70),
 [rows] int,
 reserved varchar(20),
 data varchar(20),
 index_size varchar(20),
 unused varchar(20),
)

DELCARE @name varchar(70)
DECLARE cur CURSOR FOR select name from …
more ...

Creating proxied http requests with PowerShell

I'm working on some sort of HTTP proxy (maybe more details about it later), and to test it I've created a short PowerShell script.
Note it also performs basic authentication voluntarily (without waiting for a server challenge) by injecting an Authorization header, because I was testing something extra special.
I …

more ...

Active Directory's Object Specific ACEs and PowerShell

I recently checked the option of handing out AD permissions through PowerShell scripts, and I found out that setting object-specific ACEs is not trivial scriptwise.
Active Directory ACE (access control entries) are different from your regular ACEs (for example, NTFS), because they can be used to grant permissions only on …

more ...