Stupid Admin Tricks – Managing Services with Windows Powershell

So, you’re in the middle of doing an implementation of some kind and you’re running into an issue that requires restarting a set of services in sequence each time a change is made.  Since you’re troubleshooting, the number of times that sequence of services needs to be restarted is unknown.

If you don’t feel like clicking things over and over again and would rather have a concise way of iterating on that process, then Powershell offers some cool ways of doing it using built-in cmdlets inherent to a default instance.

Continue reading

How to deal with non-alphanumeric character pipeline output in a PowerShell script

In the last post, I posted the beginnings of Show-OldLogs, a function I’m writing that will automate the handling of log files at a target location.  The posted instance is rudimentary, in that it’s designed to check for files older than a specified number of days and delete them.  It also didn’t need to be formatted in the BEGIN/PROCESS/END block format but that’s a forced reminder to myself to make the function behave more like a ‘show’ verb (maybe I’ll change it to ‘get’ to match normal PS cmdlet intentions).  But I digress.

The issue I encountered had to do with special characters being in the directory path that was preventing Remove-Item from functioning properly.  This is the format of the path:

C:\Program Files\CompanyName\Application\Reports\Subfolder [SERVERNAME]\

The square brackets in the directory path was breaking Remove-Item and, as a result, it prevented the execution of the line.  Some Google-Fu lead me to the answer I was looking for and it caused me to think about something. Continue reading

The Evolution of Show-Oldlogs

I’ve taken a liking to PowerShell.  VBScript never really did it for me in the past and I never dug into general Windows Command Prompt usage until about 6 months ago or so.  Blogs like the Command Line Kung Fu blog and if your Google-Fu is good enough, you’ll end up with a tapestry of bookmarks that will better round out your CLI prowess.

That said, after diving into WMIC a bit, the more I got my hands on system information, the more my brain wanted to do automated tasks with it.  With my new-found appreciation for WMI and the Get-WMIObject Cmdlet from PowerShell, the two technologies blended together like peanut butter and jelly (or whiskey and a cigar, if that’s more your speed).  So, I wanted to write something simple that could be reused for general maintenance tasks. Continue reading

WMI Primer – Through the MS Looking Glass

With Windows PowerShell coming in it’s third iteration, command-line based administration within a Windows environment is now rich, informative, and relatively simple to use.  The traditional Windows command prompt does offer similar functionality, but the toolsets in that environment are pretty kludgey at best.  Windows PowerShell puts a fresh coat of paint over that antiquated interface and adds some of the command-line grace that *nix Administrators have had for decades.

That said, a lot of the power from either PowerShell or the command prompt stems from Windows Management Instrumentation, or WMI for short.  This post will briefly speak to WMI’s default namespace and different means of interacting with WMI to query for information.

Continue reading

Citrix will drive you to drink

Vodka (or other libation) required for Citrix Administration

My professional career has lead me down a path of breadth of skillset versus depth.  The latest discipline that I’ve been tasked with learning is Citrix.  I say Citrix as a flat discipline because it goes beyond just implementing XenDesktop onto a different hypervisor.  This is the Citrix trinity of XenServer, XenDesktop, and XenApp.  There are other Citrix appliances and accessories associated with new dive into unknown technologies for me, however, the core focus of this posting will be about the lack of ease of implementing all of these technologies in a best practices environment. Continue reading

Who will empower the users?

ANSWERS - Y U NO GIVEA lot of people forget where they’ve come from. They forget the trial and error methods involved with them becoming a more self-sufficient person with whatever facet they are rising through the ranks in. When they supersede their peers and when those peers become ‘users’, they move from being in a communal mindset that tries to help one another while helping oneself to one of contempt as to why your (former) peers did not come up to speed as fast as you.

That said, there has been a calling from people in the information security industry like Chris Nickerson and Jayson E. Street who make points about the lack of collaboration in the industry (Nickerson) and how empowering the users can act as a first line of defense for an organization’s security (Nickerson/Street). While the idea of empowering users has been quietly championed by many industries, the thought of empowering users can be a hard sell to an organization. Even if you do get the okay to begin educating your users, that can prove to be an uphill battle with how technology is marketed to consumers/users.
Continue reading

Content First, Layout Later

So I decided to fire up the ol’ blog again to start writing and, hopefully, contributing more to the community.  Hell, I never contributed much in the past whenever I would start these kinds of efforts and, as a result, the desire would just end up petering out before any kind of traction could be gained.

The current domain this is being hosted on (selpadesigns.com) is where this is going to start while I sort out what domain will be its final home.  The design aspect may be sprinkled in here and there, however, the content will have a heavier lean toward non-design topics, such as information security/technology, music, and language.

The layout for the page is being worked out and will be my first HTML5 project with a focus on mobile layouts and desktop layouts being secondary.  While that’s being hashed out, however, I’ll write to spare having to stare down lipsum while working out how a layout works with content filling the template (even though it would be tempting to stare at some Samuel L. Ipsum.