Normally to set permissions on attributes I have to use ADSIedit to navigate to that object, and then go through all the security tabs scroll […]
Continue readingWITH Syntax to Delete Duplicate Records with No Primary Key
If you are missing a primary key, here is a great way to delete duplicate records in an SQL table. This example uses WITH to […]
Continue readingUse PowerShell to change service accounts through SQL Configuration Manager
Works with SQL 2008 R2. I use PowerShell to update the Service Accounts for the SQL Server, Agent, and Analysis Server: $servername = “ServerName”; [System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SqlServer.SqlWmiManagement”) […]
Continue readingPHP Regular Expression to Remove A Tag
I needed to remove a tag and all the text within a tag. Sounds easy enough. Here is the HTML: $content = ‘Hello <div id=”tag_to_remove”>I […]
Continue readingJavaScript RegExp to Replace Between Text
I wanted to replace all text between two tags. It seems odd, but it resovled an issue I had. Here is the text: Hello<table> <tr> […]
Continue readingInsert a string at a position within another string
I needed to insert a string within another string at a specific position. It is easy to retrieve the position of a string within another […]
Continue readingPowerShell to Search Registry
The following bit of PowerShell code will search the registry for a string. Update $Filter with the string you are searching for and the registry […]
Continue readingHow to install Powershell ISE on Windows 7 or Server 2008 R2
Run the following Powershell command: Import-Module ServerManager; Add-WindowsFeature PowerShell-ISE
Continue readingSet Registry Key Permissions with PowerShell
I found very little information on this object, so I decided to blog about it. The RegistryAccessRule parameters are as follows: RegistryAccessRule (“domain\username”,”Permissions”,”ContainerInherit”,”None”,”Allow”) Where Permissions […]
Continue readingCleaning up my log file in SQL 2008 R2
This morning I noticed that my log file was 450 GB. With only 30 GB remaining on the drive, I had to shrink the file. […]
Continue reading