EC2 Instance Auto-Scaling group with automatic computer join and removal from an Active Directory domain.

The Problem Depending on the elasticity of your auto scaling group(s), this can typically leave a large trail of computer objects behind. Retroactive removal of computer objects from a directory is never without risk; typically scheduled scripts scan computer objects for objects with old computer passwords, often coupled with DNS and/or ICMP (ping) checks to […]

Read More EC2 Instance Auto-Scaling group with automatic computer join and removal from an Active Directory domain.

SCOM – Powershell Dynamic Group Inclusion for systems based on AD sitecode

function Create-Group{ Param( [parameter(Mandatory=$true)] $ManagementServer, [parameter(Mandatory=$true)] $ManagementPackID, [parameter(Mandatory=$true)] $GroupID, [parameter(Mandatory=$true)] $GroupName, [parameter(Mandatory=$true)] $SiteCode ) Write-Host “ManagementServer: “$ManagementServerWrite-Host “ManagementPackID: “$ManagementPackIDWrite-Host “GroupID: “$GroupIDWrite-Host “GroupName: “$GroupNameWrite-Host “SiteCode: “$SiteCode[bool]$SUCCESS function CreateManagementPack{ param([object]$MG, [string]$ManagementPackID) $MPStore = New-Object Microsoft.EnterpriseManagement.Configuration.IO.ManagementPackFileStore $MP = New-Object Microsoft.EnterpriseManagement.Configuration.ManagementPack($ManagementPackID, $ManagementPackID, (New-Object Version(1, 0, 0)), $MPStore) $MG.ImportManagementPack($MP)} function XMLEncode{ param([string]$s) $s = $s.Replace(“&”, “&amp;”) $s = $s.Replace(“<“, “&lt;”) […]

Read More SCOM – Powershell Dynamic Group Inclusion for systems based on AD sitecode

C# Winforms – Validate integer Method

Came across this method to validate a textbox for integers only: As simpled as referencing the validateTextInteger Textbox textchanged event        private void validateTextInteger(object sender, EventArgs e)        {            Exception X = new Exception();            TextBox T = (TextBox)sender;            try            {                if (T.Text != “-“)                {                    int x = […]

Read More C# Winforms – Validate integer Method