Uncategorized
Brocade Clone Config
by dwarfsoft on Jun.22, 2015, under Scripting, Storage, Uncategorized, Work
I was attempting to get a cloned configuration on Brocade switches as part of a PowerShell script that is adding Aliases and Zones to the Active Config. The original code that created the tasks to be run on the Brocade switch required 2 separate calls to PLINK in order to get all its information. The first was a call to cfgactvshow, and the second was a call to alishow. I knew there had to be a better way, so I developed the following one liner for cloning the active zone configuration based on our standard rules:
zoneobjectcopy "`cfg=\`cfgactvshow|grep "cfg:"\`;echo ${cfg:6}\", \"${cfg:6}_\`date +\"%Y%m%d%H%M%S\"\``" |
PowerShell PowerISE Copy-Script Add-On
by dwarfsoft on Nov.16, 2012, under Uncategorized
One of the most useful things I get to use in day to day scripting is Copy-Script. It is a script that I originally picked up from this msdn blog. I have since made a couple of modifications to allow me to reload it with the rest of my profile, as well as my most recent addition: Converting the Formatted Text to Word Document format.
The reason I needed to use Word Document format was due to OneNote and Lync not taking the RTF formatted data until it had been pasted and copied out of Microsoft Word. Therefore I added the following process into the end of the script:
PowerShell, Exchange 2010, and MPS Report Sanitization
by dwarfsoft on Jul.13, 2012, under Uncategorized
I’ve spent a lot of time over the last couple of weeks buried in PowerShell scripting. Mostly PowerShell 1, but some VMWare PowerCLI and some Exchange 2010 PowerShell Scripting.
I look forward to posting up some code, particularly for performing some Post Server-Build tasks and rebuild tasks after some experience failing to get Exchange 2010 Setup /m:RecoverServer working (and having it remove all instances of the server from the AD Configuration).
Additionally, today I spent a lot of the day working on a script to Sanitize MPS Reports. So far I have a Powershell 1 script that can extract the entirety of the MPS Cab (Maintaining folder structure) and I’m on the way to getting regex to clean the files of any IP Addresses, Site info, AD Structure, and User Data. As I work for an Outsourcer to a Government Department, there are certain things we are and are not allowed to send to external sources… Having found very few Sanitization products available (and none that were flexible enough for my liking, although Notepad++ Regex Replacement on Folder was very close) I decided to write my own. Next week I hope to bring some scripts to the fore on this task.
Back in the gtd-php saddle
by dwarfsoft on Sep.06, 2011, under Uncategorized
I’ve started having a look back at some of my gtd-php project ideas and made some progress since the last time I looked at them. Turns out that one of the bugs I was experiencing was a result of a funny session issue (by running a dev and prod instance from the same browser).
I’ll need to look into it further but it does appear that at least some of my ideas can be implemented as part of the standard addon scheme.
Cheers, Chris.
VBScript INI File Handler
by dwarfsoft on Nov.23, 2010, under Uncategorized
As you may know, I posted a while ago about how to handle INI files using VBScript if you can’t use the Word.Application object System.PrivateProfileString function.
Over at CodeProject there has been a more recent submission which includes a VB.Net, C# and VBScript solution that is a little more elegant than mine. It uses Regular Expressions to parse the INI File (which I would use now if I had been building it now), but still utilises the Scripting.Dictionary object for organising sections, keys and values.
Enjoy,
MSI Package Code Fun
by dwarfsoft on Jun.22, 2010, under Uncategorized
I have recently been building quite a few MSI packages, and as of the end of last week I was required to go back through and rebuild a whole batch of them. Due to the way a lot of deployments work from Novell Zenworks, Product Codes are used quite frequently to stop the MSI from installing more than once (thereby disabling multiple installs). I believe that this is due to the MSI Template that is used corporately having a few Dialogs missing for Repair/Modify. Therefore when the second install occurs the MSI dies a painful death and the user is presented with a number of errors.
So, rather than fix the source of the problem I work within the structure I am given. After my forays in the past couple of days I found it immensely frustrating trying to get the Product Code key to update our documentation for each MSI which had been rebuilt. This is because, up until now, I had been installing the MSI and searching for the MSI name under HKEY_CLASSES_ROOT\Installer\Product\. The code displayed under this key had confused me for quite some time until I found some information regarding a “Packed GUID“.
Updated GTD-PHP POP3 Inbox Import
by dwarfsoft on Aug.04, 2009, under Uncategorized
So I have been using the new script this morning, and testing adding new actions from the GroupWise account at work. Here is where I encountered some issues.
GroupWise decides it wants to MIME Encode the email, which brings about my first problem. I need to account for multiple MIME Parts. After resolving this my next issue is that the corporate email gateway decides to append a massive disclaimer at the bottom of the email, bloating my item by at least 1000%. So I implemented the ability to cut out disclaimers based on a stripos call. I can have a list of different filters here and it will cut them all out.
After fixing this up and resolving the functional issues I logged this addon as a ticket in the GTD-PHP Trac system.
GroupWise Audit and Batch/Cmd Escaping
by dwarfsoft on Jul.27, 2009, under Novell, Scripting, Tweet, Uncategorized, Work
I was required recently to audit passwords on all the Novell GroupWise accounts in the cluster. This was not too much of a problem using existing solutions, except that all the existing solutions limited searches to either Users, or to objects with the “NGW: Object ID” attribute.
The Solutions I found include Check GroupWise Users for Password – Batch and Check GroupWise Users for Password – Exe, both of which made use of GWSend. Being an avid scripting aficionado myself I opted for the first, so I could make changes.
First step was to export all User Objects with NGW: Object ID into an Excel sheet using DSReport. Then export all GroupWise External Entities with NGW: Object ID to a different Excel Sheet. Finally I needed to export all GroupWise Resources, which do not have an NGW: Object ID, but their CN is effectively the NGW: Object ID for which we can log in and try to send emails. Upon completing this I compiled a single list of Allusers.csv which had the NGW: ObjectID/CN in the first column, and the DN for the Object Name and Location within the tree. This makes it far easier to track down the location of generic accounts (Something that none of the scripts account for).
Back from Training
by dwarfsoft on May.09, 2007, under Uncategorized
I have returned tonight from training in Brisbane, and the course was actually fairly interesting to go through. Fortunately the GroupWise 7 Interface allows much the same access to GroupWise 6.5, but has some of the nicer Tab features of OWA and the like. The Interface actually feels a lot more responsive than older versions, and the new features make it a lot more useful.
Of course, not all of the features we learned about can be applied directly to our work, and some of them can be used in outright malicious ways. I will look into some potential pranks that can be played with people around the office. I need to get some sleep now before work tomorrow so I’ll pack it in now.
Cheers, Chris.
Welcome back to GPA
by dwarfsoft on Apr.30, 2007, under Uncategorized
Hello, and welcome to dwarfsoft [GPA] (Game Programming Alchemy). I have finally decided to make this site more managable in that I should be able to add ideas from work without too much hassle, which I cannot do with the old Static HTML site.
It is about time that this site started being used for more than just a dumping ground for my funny images and much more than just a subversion backup repository for whatever project I happen to be working on. I hope to start using this to organise my thoughts on a couple of fronts, such as Avengeance, Empyrean Gate, and NGDN.
In the meantime I have to get used to how WordPress works in order to get the site set up the way I like it. This learning experience will in the very least give me some idea of web technology integration which will benefit NGDN when I get around to it.