Browsing Category: "Automation"

Starting Performance Monitoring

Automation, Scripting, Servers December 30th, 2009

Previously, I’ve been in control of the environment that I have been monitoring, so I was able to integrate that performance monitoring into PolyMon.  Now that I have a slightly different scenario, I’ve had to modify my performance monitoring strategy.

I’ve mainly been concerned about general server performance, as well as IIS and SQL performance (Basic, IIS, SQL 2005, IIS and SQL 2005), so I’ve been using counter sets that mirror that.

Then I wrapped a couple of calls to logman.exe, which is the command line interface to PerfMon counters.

To create the counter, I used

logman create counter BlackBox -v mmddhhmm -cf Counters.txt -si 00:10 -f bincirc -o “c:\Perflogs\Blackbox_%computername%” -max 250

which creates a counter named “BlackBox” (like a flight recorder).

The command also:

  • reads in the counters from a text file (see my examples above). 
  • sets the sample interval to be every 10 minutes (“-si”).
  • sets the log file is a binary circular file (set by the ‘”-f”), which would be a maximum of 250 MB (set by “–max”)
  • sets the log file location and name (using the computer name environmental variable to append the computer name to the log file) and the “-v” option also adds the month, day, hour, and minute of the start of the log to the file name.

After creating the counter, I used

to start the capture of the counter information.

Finally, I have another command to stop the capture, so when there is an issue or after a specified period of monitoring, I can grab the log file and feed it to PAL or load it in PerfMon (on Server 2008 or greater – as PerfMon got some nice feature bumps with the more recent releases) and analyze it there or export it to a CSV file to slice into it with Excel.

Have Fun!

Resources:

Runas Radio Shows –

Technet Article – Taking Your Server’s Pulse

PAL – Performance Analysis Of Logs

Are you following the PowerShell Twitterers?

Automation, Scripting December 26th, 2008

If you are interested in PowerShell and are on Twitter, I’ve compiled a (continuously expanding) list of Twitterers who often have PowerShell related content.

To make it a bit easier, I’ve written a script that will parse that list, compare it to whom you currently follow, and follow anyone you are missing.

The script (Add-PoShTwitterFriend) can be found here.

The list of PowerShell Twitterers can be found here.   If you are into PowerShell and on Twitter but not on the list, let me know (@stevenmurawski), I know I’m missing some people.

 

UPDATED…. Thanks to a tip from Jeffery Hicks, I updated the Add-PoshTwitterFriend script so it should run more smoothly

The Most Compelling Feature of PowerShell

Automation, Scripting December 22nd, 2008

I’m often asked why I like PowerShell so much. There are a number of reasons, but what I find most compelling about PowerShell is that it is an enabling technology.  With PowerShell, I am in charge of my admin might.  There is nowhere my shell cannot reach…  (ok.. maybe I’ve watched a few too many Conan movies).  The point is that I don’t have to rely on an outside party to customize their management experience to my environment.

With applications that support PowerShell, my general Active Directory environment, and those applications and datastores that can be coerced into working with PowerShell, PowerShell provides me a way to create the management tools that I need, specific to my environment.

  • My custom .NET based application with a SQL backend doesn’t keep user information syncronized with my Active Directory.. No problem, schedule a PowerShell script to run and verify the information.
  • Want to take a look at the door access control system users and find the users whose Active Directory accounts are disabled? Not a problem for PowerShell.
  • Have fifty new user accounts that need to be added to both those applications and Active Directory and need mailboxes enabled? PowerShell to the rescue.
  • Need to retrieve a photo that is stored as a BLOB in a database and save it to your local filesystem. Easy, with a bit of PowerShell.
  • Want to read through an XML Configuration file, find a few elements and verify them against machine settings or other configurations? Can do! XML is a breeze to work with in PowerShell.

PowerShell allows me to create and define my own administrative tasks through the creation of scripts, functions, and cmdlets, which empowers me as an administrator to get my job done in as efficient a manner as possible.  I can also modularize my tasks (which makes them easier to share).  By isolating the tasks into reusable bits of PowerShell, I can quickly respond to a changing environment, creating custom workflows as needed.

If I’m having trouble with my task, I can turn to the PowerShell chat room on irc.freenode.net, ask a question in the forums at PowerShellCommunity.Org, or turn to one of the numerous books, blog entries, or script samples from PoShCode.org for inspiration.

Then, once I’ve solved a problem, I can share the solution with others via a community site like PoShCode.org.

Coming up on the Live Stream (Episode #77)…

Automation, Career, Podcast, Scripting, Servers November 24th, 2008

We will be streaming episode #77 live on Ustream.tv on Wednesday, November 26th at 8:30 PM CST.  We will have Brent Ozar, SQL Server Expert for Quest Software, joining us to talk about becoming a DBA (Database Administrator), a sysadmin’s guide to working with DBA’s, and tips for sysadmins who have become “Accidental DBA’s”.  We’ll also have a discussion about DBA’s and scripting, and some news from the PASS (The Professional Assoication for SQL Server) Summit.

 See you there!!

Secure Delete

Automation, Desktops, General Interest, Scripting, Security October 29th, 2007

I caught this one recently on an episode of CyberSpeak (10/15 show)…..

There are a lot of “secure” file deletion applications out there, but these two look quick and simple and can be used on-the-fly from a thumb drive or automated in a script.

SDelete from Sysinternals/Microsoft

Cipher (included with Windows 2000 and above)

Assuming you do the right thing and migrate all of your confidential data to an encrypted TrueCrypt volume, what do you do with the old copies of the data? You can securely erase the data using these tools so that the only recoverable copy is in your encrypted volume.

Some systems use a data interchange folder to integrate two disparate systems. One system will drop an export file in the directory and the other system will import the file from the directory. I’ve seen POS systems integrate to credit card processing systems in this manner. With this tool, you can script a cron job to regularly securely delete the interchange files in the directory.

Just another layer of security to consider.

Episode 12 – It’s Pronounced Kickstart

Automation, Desktops, General Interest, Networking, OLPC, Patches, Servers, SPAM August 18th, 2007

Recorded: August 14, 2007
Your Hosts: Keith Albright and Rich Niemeier

Show Length: 1:33:58

Sorry it took so long to edit and post. I took a couple vacation days and didn’t get to do the final steps.

Just Rich and I this episode…..unless you count ‘Virtual Ted’. Rich and I cover the usual gamut of news topics; Novell/SCO Unix lawsuit, Google’s 700Mhz Spectrum bid, and a NJ beach town’s plans to be the next technological marvel. Rich uncovers follow-up information about the health-risks of laser printers. We discuss what Apple can do to help with lost/stolen iPods and how to audit USB device usage on your network. We end with our website picks and as usual, we hope you enjoy.
Links mentioned in this show:

Other podcasts mentioned in this show:

None

See the full show notes here.

Website Picks:

Keith’s Pick: NPA Lookup Tool

Rich’s Pick: New video site – VBS.TV

Listen Now:

Download Here

Microsoft Patches

Automation, Desktops, Patches, Scripting, Security April 25th, 2007

A quick note on a couple of recent Microsoft patches that you might find relevant.

If you have installed the Microsoft MS07-017 (KB925902) patch and had a problem with your systems receiving the following errors:

application_executable_name – Illegal System DLL Relocation

The system DLL user32.dll was relocated in memory. The application will not run properly. The relocation occurred because the DLL C:\Windows\System32\Hhctrl.ocx occupied an address range reserved for Windows system DLLs. The vendor supplying the DLL should be contacted for a new DLL.

Check out the following MS Knowledgebase article and related patch.  I’ve downloaded the patch and applied it successfully to my systems with the Realtek Audio software.

MS Knowledgebase Article 935448

Update for WindowsXP (KB935448)

I use the Kixtart scripting language for my login scripts, so it was easy to deploy the original patch as well as the follow-up Realtek patch using the following script:

AT ( 1,1) “A critical security patch is needed on your computer.”
AT ( 2,1) “Please wait while your system is updated……..”

IF EXIST (“C:\WINNT\$NtUninstallKB925902$”) OR EXIST (“C:\WINDOWS\$NtUninstallKB925902$”)
             AT (4,1) “Microsoft Exploit Patch already applied”
             IF EXIST (“C:\WINNT\$NtUninstallKB935448$”) OR EXIST (“C:\WINDOWS\$NtUninstallKB935448$”)
                          AT (6,1) “Realtek Patch Already Applied”
             ELSE
                          IF @producttype = “Windows XP Professional”
                              AT (6,1) “Installing Realtek Patch…..”
                              SHELL “\\DOMAINCONTROLLER\NETLOGON\PATCHES\KB935448.exe /QUIET /NORESTART”
                          ENDIF
             ENDIF

ELSE
             if @producttype = “Windows 2000 Professional”
                AT (4,1) “Patching Windows 2000 Professional…….”
                SHELL “\\DOMAINCONTROLLER\NETLOGON\PATCHES\2000.EXE /QUIET /NORESTART”
             endif

             if @producttype = “Windows XP Professional”
                AT (4,1) “Patching WindowsXP Professional……..”
                SHELL “\\DOMAINCONTROLLER\NETLOGON\PATCHES\XP.EXE /QUIET /NORESTART”
             endif

ENDIF
AT (8,1) “Your system has been patched.”

Hopefully you find this useful. 

Oh, and if you are not using a robust scripting language, you should check out KiXstart.  It’s released as CareWare, so please do your part and make a donation to one of the listed organizations.

KiXtart website

Keith

blank