How to skip the first line with import-csv

Wednesday, September 3rd, 2014

I had a “quick and dirty” script to examine a list of hosts from a CSV.

There was a header with the data and I didn’t want the error that would pop up at the end of the foreach loop.

To get around the first line; I used a pipe and the select statement:

Import-Csv $file -header(“Hostname”, “OldIP”, “NewIP”) | select -Skip 1 | foreach {

Simple and it avoids a comparison check in the code.

The only thing to be concerned is if there are times there will be files without a header.

saveIndx: Unknown index name from ELIM

Monday, August 11th, 2014

While reviewing a server for an issue; I noticed a few messages from LSF.

saveIndx: Unknown index name <name> from ELIM

This message is reported a missing flag from lsf.shared. A quick edit and a process and service restart and the message went away.

 

Learning is a never ending adventure

Sunday, August 10th, 2014

If you are lucky to have a company which will pay for professional training, count your blessings. All to often, there is little or no budget for such things. Add in the mentality of “if we train them, they will leave!” pretty well eliminates professional training.

To remain employed, you always have to stay current and read and play with new things as much as possible.

As the year is coming to the end, people start making predictions as to what will be the hot knowledge for the next year.

Such is the case with this blog entry. And of course, I have my viewpoints. 😉

Migration to the Cloud is going to remain the effort as the reduction of IT people seems to be on many peoples minds. Many will try to fight it. Having survived a couple of reduction efforts, I advise all to embrace it and get involved if at all possible. It doesn’t matter, it’s a leaky sieve in matters of security. Companies will attempt it and declare it a success no matter the result. I would like to get involved with the Cloud; however, at the moment I don’t have access.

As to Powershell;if you work in the windows world, you are are foolish not to know it. I have finally started playing with it and now wish I had started awhile ago. It’s fun and it makes life easier!

IPv6; we have heard about it for a long time. It’s will start appearing! Just recently, Microsoft announced it ran out of IPv4 addresses for Azure. I expect other companies to run into the same problem.

Security is a good thing to understand. I don’t know if we are changing to a security minded world as some of the hype is motivated by the recent examples of security failures. It may be the start of a trend or it could very well be the usual fad and get reduced in effort as events die down and security starts being a massive expense. The security world is a certain type of mindset. It would be good to talk to a few people before deciding this will get you a job as with the glut of IT workers awhile ago. Many people working but many didn’t have the aptitude.

Compliance is rather boring for me. Not something I would want a career.

Vmware and Hyper-V are are mentioned but I am wondering if virtualization is becoming one of those expected skills but will not do much for you. I have used vmware and am currently getting ready to play with a Hyper-V cluster.

Office 365 and Google apps are growing. I can see this being a good thing to know especially when I hear more and more arguments of why do volume license when you can basically rent what you need? I am considering looking into Google Apps certification.

Time to start reading and setting up test environments!

 

FMD log files are large!

Friday, August 8th, 2014

A trouble call reported an old server running Solaris 10 with a full root partition.

Looking around I noticed the FMD log files were quite large and the active file was growing.  To ease the space condition, I deleted the rotated files (ie .0, .1, etc.) and started looking into what was the problem.

The Solaris Fault Management Facility was created to provide a self-healing capability.  It through the fmd daemon monitors various aspects of system health and as in this case, logged many messages for system issues.

The first obvious check was to use the fmadm faulty command to see if anything was flagged as faulty. In this situation; there was a bad dimm.

This wasn’t enough to fill log files so I had a look at /var/fm/fmd file and it had several entries for a processor.

The fmstat command which will report statistics logged by fmd and it’s modules confirmed the log activity.

Since it was an old server with no warranty; the hardware people were notified to look at the server and retire it if they couldn’t repair it.

Please wait for the System Event Notfication Service…

Thursday, August 7th, 2014

One of the most annoying things is a server which is hung up and won’t allow you to access it remotely. Especially, if it requires driving to get to the server.

Such was the case of a trouble call from a user trying to access a server. He would try remote desktop and received the following message:

Please wait for the System Event Notification Service…

The login process would remain at this point.

Remote Reboot failed but the system would ping and I could mount a hidden drive.

I needed remote desktop to work so I could look into this problem.

The System Event Notification Service as described from an article in the Microsoft Developer Network states:

Applications designed for use by mobile users require a unique set of connectivity functions and notifications. In the past these individual applications were required to implement these features internally. The System Event Notification Service (SENS) now provides these capabilities in the operating system, creating a uniform connectivity and notification interface for applications. Using SENS developers can determine connection bandwidth and latency information from within their application and optimize the application’s operation based on those conditions.

It sounds like something that is not needed, but it wasn’t the time to make this call when there was an annoyed user waiting for the server. I suspected we could at least kill the process and see if Remote Desktop would work again. Time to use the useful SC command:

sc \\servername queryex SENS

This returned:

SERVICE_NAME: sens
TYPE               : 20  WIN32_SHARE_PROCESS
STATE              : 4  RUNNING
(STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE    : 0  (0x0)
SERVICE_EXIT_CODE  : 0  (0x0)
CHECKPOINT         : 0x0
WAIT_HINT          : 0x0
PID                : 976
FLAGS              :

Using the PID; I could attempt a taskkill of the sens process.

taskkill /S <servername> /PID 976 /F

This made the login session continue and I had access to the server.

Checking the Net; there are a several situations which could cause this condition.  It ranged from removing Live Messenger (which was not installed), registry changes (which didn’t work or didn’t apply) to removing an update (which was not installed).

I had to log out and found the error was back.  I used the same taskkill steps and was able to access the server again.

Not seeing the obvious; I figured I would try the “fix most things Microsoft” solution and rebooted.

The error went away.

Sometimes a reboot is all that is needed.

 

Missing license server for windows 2012 Remote Desktop Services

Wednesday, August 6th, 2014

Windows Server 2012 can be a little disconcerting due to the new look and layout.

Such was the case for a request of a 2012 server with Remote Desktop Services enabled. I installed the OS and added it to AD. I installed the requested applications and then I went through the wizard and installed the “Remote Desktop Session Host.”

I didn’t need the license server installed as I have a couple already in place.

When it came time to configure verify the setup; I went to Administrative Tools and looked at Remote Desktop Services and only found “RD Licensing Diagnoser”

Ok? Where do I configure the license servers?  Oh wait! the Dashboard.  I looked under that and found the same thing.

I reinstalled the role and found nothing changed.

I did get the warning about licenses and so I ran the diagnoser to see what was wrong.  Two license servers were found but the problem was the missing license server had the licenses for 2012.

Time became an issue and I literally had the user panicking to use the server so I needed a quick resolution as this system was a short term “crash and burn” setup.

I decided to add the missing entry via the registry and reboot.

The license server list can be found here:

HKLM\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows NT\Terminal Services

The entry you need to modify is : LicenseServers

I added the missing license server to the list and rebooted.

The warning message about licenses went away and I verified multiple users could access the server.

Time to crack open the 2012 books and papers!

 

An iPad experiment on reducing paper usage.

Sunday, July 20th, 2014

In today’s world; under-staffing seems to be a business norm. This in turn causes a position to absorb other positions and create a need to track several things.

I had an epiphany one day while cleaning my messenger bag. I had a few note books, a few scratch pads, and my iPad. Like most people notebooks and scratch pads were for quick notes and meetings. While the iPad was for browsing, email and of course never for games *coughs*.

My bag always feels like it  increases in weight and I thought “Can’t i get rid of the paper?”

I decided to embark on an experiment to use the iPad as a note book and scratch pad.

The iPad is an iPad air basic edition without the cellular connection.

The issues:

1) A program to act as a notebook and possible scratch pad.

2) A program for a scratch pad in case I can’t find one for both.

3) A stylus which can write fine or medium point.

4) Do I need screen protection?

Preliminary research shows endless opinions on this topic and of course everybody has their own needs.

Mine are simple. I want to be able to write fine or medium point to take quick notes, notes in meetings and notes from research.  Drawing is not a requirement as when it is needed; detail tends to be light.

Next will entry will be the screen protection.

An extended error has occurred

Thursday, July 10th, 2014

New operating systems always bring new error messages. Such was a recent incident for a Windows 2012 server trying to access a share on a Network Appliance Filer:

An extended error has occurred

A quick test of my Windows 8.1 laptop produced the same error.

We have been playing around with SMBv3 on the Netapp filers and this was thought to have been an issue as the new OS is more SMBv3 “friendly.”

The filer people said they configured the filer to use smbv2 but the error continued.

Originally, I wrote about this a year ago with this post but you can review the support article.

I suspected either signed support was not configured or can’t be used so I opted to disable it via Powershell and the command(start it in admin mode):

Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" RequireSecureNegotiate -Value 0 -Force

A reboot of the server (just because) and we had access to the share.

For those that want to get some features information on SMBv3 and 2012, you can look at this article.

What is my version of cygwin?

Wednesday, June 18th, 2014

Cygwin is a *nix-like interface for windows.  Like all applications, it has versions and sometimes that can be an issue.

There is the command:

cygcheck -srv

But, there is a great deal of information so you would have to use grep to get what you need.

A quick and simple approach would be the old trusty “uname” command.

 ~
$ uname -srv
CYGWIN_NT-6.1-WOW64 1.8.3(0.237/5/3) 2011-03-30 12:12

 ~
$ uname -r
1.8.3(0.237/5/3)

Now if only I could convince some people you don’t have to stay at a version forever. 😉

 

 

Can’t remote desktop to a windows 2008 R2 server

Tuesday, June 17th, 2014

This was a strange problem. I have a simple Windows 2008 R2 server with remote desktop services installed. Everything was properly configured. Plenty of licenses and diagnostics reported the license server was available.

The problem? Can’t access the server through remote desktop. No errors in the logs and the only message available to me was the generic:

Did all the noob checks and I even reloaded Remote Desktop Services, removed and re-added the server to AD.

Still no access.

I installed tightvnc as I did not want to live at the machine and found I had remote access.

I checked the registry to see if port 3389 was configured and it was.

I used portqueryui to see if the port was in use and it reported:

TCP port 3389 (ms-wbt-server service): NOT LISTENING!

A quick telnet to port 3389 confirmed this.

The firewall was not running and there wasn’t a web server or any other process trying to use that port and thus block Remote Desktop Services. I was tempted to declare too much time debugging this and reload but I decided to dig around the Net a little more and stumbled on an old discussion on technet.

As mentioned in the post by itdoug; I found the hidden device driver called “remote desktop services security filter driver” disabled (You just bring up the Device Manager, select show hidden devices and look under Non-Plug and Play Drivers).

I tried to enable it and it failed. I then uninstalled it and rebooted.

Remote Desktop worked after that.