Quantcast
Channel: Scripting – Robin CM's IT Blog
Browsing latest articles
Browse All 27 View Live

Image may be NSFW.
Clik here to view.

Get and delete DNS A and PTR records via PowerShell

My Remote Desktop Session Host build process is now pretty slick. I can easily rebuild a lot of RDSH VMs very quickly. The process basically involved powering off the existing VM, deleting both it and...

View Article


Image may be NSFW.
Clik here to view.

Powershell function to pin and unpin from Windows Taskbar

Wrote this to make it easy to add and remove pinned items from the taskbar. Code function Pin-Taskbar([string]$Item = "",[string]$Action = ""){ if($Item -eq ""){ Write-Error -Message "You need to...

View Article


Image may be NSFW.
Clik here to view.

PowerShell: There are null values and then there are SQL null values

I was reading some data out of a SQL Server table, and wanted to do an operation if one of the string values returned, MAC, was either blank or null. I was using the following code: $NewServerName =...

View Article

Image may be NSFW.
Clik here to view.

Missing row when using ExecuteReader to fill a DataTable

I’ve been using the following PowerShell code to retrieve the contents of an SQL Server table and store it in a DataTable for fast local processing: $BuildDBConnection = New-Object -TypeName...

View Article

Image may be NSFW.
Clik here to view.

PowerShell: Finding user sessions on RDSH servers

If you’ve been working with Citrix Metaframe/Presentation Server/XenApp and/or Microsoft Terminal Server/Terminal Services/Remote Desktop Session Host for a while you’ll probably be familiar with the...

View Article


Image may be NSFW.
Clik here to view.

PowerShell script to get temperature from NetBotz

Wrote this to extract the temperature reading from a few NetBotz devices that I have in my datacentres. Note that the second time I call the function, it is getting the temperature from a second...

View Article

Image may be NSFW.
Clik here to view.

PowerShell: Find MTU

I had some issues caused by MTU recently, and decided to write a script to test for the Maximum Transmission Unit that a network or host could cope with. I originally started off by using the...

View Article

Image may be NSFW.
Clik here to view.

Remove Forefront Client Security by force

I was recently trying to upgrade the Antivirus software on some servers from Forefront Client Security to System Center Endpoint Protection 2012 R2. On most servers it worked fine. However on a few I...

View Article


Image may be NSFW.
Clik here to view.

Send Windows Event Logs to SQL Database

I’m currently in the process of planning for an AppLocker rollout to all my PCs (about 7,500 of them) due to an increasing amount of malware. You should probably be doing this too. Anyway, a sensible...

View Article


Image may be NSFW.
Clik here to view.

Send notification email from SCCM 2012 Task Sequence

I wanted to be able to send an email from a step in a SCCM 2012 OS Deployment (OSD) task sequence. This was so that I could be notified when the task sequence had completed successfully. The account...

View Article
Browsing latest articles
Browse All 27 View Live