This might take you 3 minutes to read.

Problem to solve

The customer has clients with locally stored application files. The files are from an earlier application and should not be used anymore. I needed to verify that the application files was removed from the clients. I did not want to walk to each 500+ clients so I created a small script to use “test-path” to see if the files were removed and then summarise it.

Script breakdown

The script is small so I do a quick breakdown.

Get all computer-objects in AD

Retrieve all computers from AD. There is so few servers and other computers that I did not filter it.

Test if there is a DNS record for the computer

Now we iterate through the $computers and test each computer if we can find it in the DNS. The reason for the DNS lookup is that I got almost 1000 computer objects from AD and I know that there is only about 500 computers.

Test if the computer is reachable

Now we know that the computer has been live the last 7 days (DNS scavenging), so let us see if the computer is live right now.

Test if the path exists

At this point we know that the computer is reachable so let us try to verify the path.

 

Run foreach parallel

Not to watch paint dry I ran the test in parallel with powershell jobs.

Result

How did I publish my result? I returned all results in a hash table and then used the group cmdlet. I could then see that no clients had the application path on the computers.

The complete script

 

This might take you 2 minutes to read.

Have you walked home from work and had that “you know it” help call? I did today.

Going in the subway, my phone rang and I got the question “how do I show my images?”

First phone call I explained like this:

When you plug in your USB memory open it and go to “dcim” and then hold down. [command] and [a] key. Then double finger click on file. Chose preview.

The answer I got was: But nothing happens. Ok I will try. (Phone hangs up)

I continue to walk home and three minutes later the phone rings again.

I try to give the same explanation but the only response is “but why does nothing show”

I have now stopped walking and realizes that to be able to sort out this I need to see the screen. Standing on a subway platform using the phone as internet connection I download the teamviewer app and installs it on my laptop. Continue to try to navigate the slightly misunderstood user on the other end to give me the id and password.

I connect and opens finder, the USB drive and opens all images. Disconnecting after less than 1 minute. Mission accomplished, father satisfied. He could now show his latest vacation photos. The two phone calls and the teamviewer session took all in all 15 minutes.

The important lesson to learn is that even if you think a task might look very simple there can be others who struggles with it. Be kind and help others.

 

This might take you 12 minutes to read.

Last post we created a database and updated ci:s into it. Now we will continue to add data that will be used for billing.

Continue the script

Now we need to populate data into the other tables to create an inventory of CPU/memory, disk and nic changes. All this to help out with billing and inventory of VM changes.

VM properties

From the last post we now know if the VM is active in VMware we should now verify the properties around the VM. To keep an history of all properties we do not do updates but only inserts into the database.Continue reading

This might take you 11 minutes to read.

This is a two blog post divided into two posts. The second will be published within a week from this one.

Problem

Today we lack information about virtual servers in our VMware environment which cause problems within each billing period with manual labour of verifying disk size, memory and cpu of each VM. With little to no money we needed a way to inventory and save the information for others to use and present it on a website.Continue reading

This might take you 1 minute to read.

If you have setup something in an Linux environment you have most likely done some troubleshooting. The command tail -f [path] is very convenient command. I had no idea that a similar existed on Windows until recently.
In powershell to read a file, the command Get-Content is very neat. I had no idea that with “-wait” you could get the same result as in “-f” in tail. Very handy for parsing Windows firewall logs.