This is part of my Powershell Challenge, to learn more about PowerShell (PoSh) using the Learn Windows Powershell 3 in a Month of Lunches book by Don Jones.
Tag: career2
-
Powershell in a Month Day 17 – Security Alert
Security. It’s important, and I was thinking this chapter would show us more about changing security. Instead, this chapter is really an outline and discussion of what security method are built into the PoSh shell. The chapter first emphasizes that the PoSh environment doesn’t bestow and special rights or abilities to the executor. The commands just execute, or fail to execute, base do on the rights you have in windows already. I can see that as some of the commands I run at times fail when I haven’t run the shell as an administrator.From there the chapter talks about the different execution policies, which I haven’t thought much about. I end up typically changing the execution policy on each VM initially so I can run scripts to Unrestricted. I know that isn’t recommended, but I typically need things to just work.I also hadn’t realized that I could set this in a GUI in Windows. That’s good to know, and I suspect, it’s another example of where Windows is implementing PoSh commands under the hood of the GUI. It would be nice to see a Trace for PoSh to watch commands come through GUI actions.The chapter finisheds by talking about the digital signing of scripts, how it works, and what you need to do. I haven’t messed with this and it’s not a part of the lab, but it’s something I’d probably do in a large organization, or even any organzation to be sure that hte code that’s being automated and run is actually the code that has been tested.Overall, a short chapter. Slightly informative, and definitely an easy day. -
Powershell in a Month Day 16 – Working with many objects
This is part of my Powershell Challenge, to learn more about PowerShell (PoSh) using the Learn Windows Powershell 3 in a Month of Lunches book by Don Jones.
One of the great powers of T-SQL is that we can owrk with many rows at once. We use a query to tell the server what we want done to a group of objects, and then the query executes against every row that matches the filters. It’s this power that makes SQL much more efficient than the RBAR method of moving through a cursor structure. This chapter introduces the ways in which we do that with Powershell.The first part of the chapter is about batch commandlets, using things like Stop-Process receiving a pipeline of objects from something like Get-Process. I like their favorite example, which I’ve yet to run. I need to do this in a VM and see what happens.Get-Process | Stop-Process
That’s an easy concept for me, and I see how valuable this is. However not all of the cmdlets we call will handle batches. The next part of the chapter examines WMI and the Invoke-WmiMethod call, which can take a series of objects as well. I somewhat dread the idea of needing to use this method, or worse, having to call a series of methods in which I have to pass in all the parameters. It’s good to know that I need the $null parameter for those parameters I don’t want to deal with, but it’s an ugly syntax. It’s handy to know this is an option, but I think I’ll be doing MSDN research for those times that I need to work with these methods.The next part of the chapter looks at the ForEach-Object syntax. I’ve seen this in scripts, and I could guess what i does, but this starts to make sense now and I can more easily decode the scripts when I see them. Along with the $_ marker to represent an object, the whole structure of PoSh is becoming easier to read.The chapter isn’t long and and starts to spend time comparing the various methods of enumeration. That’s helpful. Seeing how the same end result can be achieved in different ways is very handy. The lab was easy, though I had to skip the WMi stuff as I was unwired at the time that I went through this chapter. However I had an idea of what to do, just no way to look up the WMI classes. -
Top Talent Leaves
Derek Jeter will likely play his entire career with the New York Yankees. LeBron James has already left one team, and might leave another soon. Both are Hall of Fame players that have had extreme success in their chosen professions. They are recognized as some of the most talented players in their sports. Why did one stay and one leave? Probably for a variety of reasons, but it seems more and more that organizations are realizing there is some value in the retention of their players and are trying to find ways to improve their success at retention.
In the business world outside of sports, we have much more freedom to change employers whenever we want. Most of us are glad we have that choice. Sometimes we move on when we don’t want to, but in the majority of cases I think technology workers leave companies because they aren’t happy about something.
There was an article about why the top talent leaves a company and I think it presents a number of issues that many employees experience within their own organizations. People aren’t engaged, respected, valued, challenged, and more. In short, they really don’t like their jobs. Many of the issues are often easy to fix, but only if you could fix two of the major items mentioned (#7 and #10). Those are leadership issues, often systemic ones that occur when upper management doesn’t care about culture or doesn’t make an effort to hire and train good managers.
I don’t know if I’d prefer to see people in technology working only a few jobs during their careers, spending decades at each, or if we are better workers with the exposure to differing environments and businesses. All I know is that I am glad that I’ve had the ability to leave bad jobs in the past, usually because of bad managers.
Steve Jones
The Voice of the DBA Podcast
Listen to the MP3 Audio ( 2.5MB) podcast or subscribe to the feed at iTunes and Mevio .

The Voice of the DBA podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music. Support this great duo at www.everydayjones.com.
-
Powershell in a Month Day 15 – Jobs
This is part of my Powershell Challenge, to learn more about PowerShell (PoSh) using the Learn Windows Powershell 3 in a Month of Lunches book by Don Jones.
Jobs are important, mostly because running stuff interactively, and manually, is a pain. The real power of PoSh administration, in my mind, is that not only can I run things across lots of servers, but I can also have some jobs run automatically. The Windows Scheduler isn’t always a part of this, though I’m not sure the PoSh system is better after reading this chapter.
It’s a short one, but one that I did like. I’ve always liked scheduling jobs and having them do work for me. I can see this being handy, but the processing of results is something that will be important. That means saving this stuff off and practicing formatting.
It’s an interesting approach here. The chapter has you create some jobs and then it explains how they work. Getting results, stopping jobs, checking them, etc. all occur as you have jobs running. All good admin things. I have the feeling I’ll refer back here as I build jobs.
The scheduling comes after there’s an explanation of jobs themselves. We learn briefly how to schedule, but not in detail. To be fair, there isn’t a lot to worry about here.
The lab was fairly easy. Most of the items were things I know how to do from the past, or I learned here. The recursing into subdirectories was a little tricky since I’ve used “/s” forever, but I needed to understand in PoSH that -recurse and -filter were needed here.
I’ll be looking to play with some scheduled jobs that might clear out old files on my machine, especially backups. This would be some good practice for a job. I certainly should create a job to trim out IIS log files since that’s something I’ve seen needed on every web server I’ve encountered.