Bio: I'm a Danish guy who's been living in Israel for the last couple of years. When I'm not sunning myself outside or spending time with my girlfriend, I work as a system admin. In my time as a system admin I have written many scripts to help me manage a large environment with lots of servers. Scripting has helped me cope with many challenging tasks and of course, to avoid spending time doing repetitive tasks. Since my scripts have helped me a lot I thought I would share them so others could use them as well. Enjoy!

View complete profile


6 thoughts on “About

  1. AC

    Hello Noam,

    I saw your blog & its a great work.. I really appreciate sharing such useful posts… Since I am new to scripting (infact a learner) I was wondering if you can help with a script. My requirement is to get details of datastore & memory usage from list of individual ESXi host and display them or send an email with details such as Hostname, its datastore size, free datastore size, Memory used & in the next line another ESXi host details and so on…

    • Hi AC,

      Thanks for your kind words about my blog. I hope it has been useful to you. Regarding your question I suggest you take this approach.
      For the memory you can get the information by getting the performance counters for each host:
      Get-VMHost “NameOfHost” | Get-Stat mem.usage.average | measure-object Value -min -max -ave
      You can refine the query with the period to get counters from and much more.
      For the Datastores I would do something like this on each host:
      Get-VMHost “NameOfHost” | Get-Datastore | where {$_.Type -eq “VMFS”}
      Then I would get the properties of each datastore returned and display them.
      To get it all in the format you want you need to play with it a little and tweak it until you get what you need.

      I hope this points you in the right direction.


  2. TES

    HI Noam,

    I stumbled upon your blog because I was looking for script that would list all the VMs in a Hyper-V Cluster, what Cluster Volume they are on as well as the name of the Cluster Shared Volume then pipe the results to an excel spreadsheet. I am very new to PowerShell and was wondering if you can assist me in creating such a script? I have used the script you creates to clean the WINSXS folder and it was very impressive; awesome work. It saved me so many man hours of trying to reclaim disk space on multiple server.
    Any help will be most appreciated.

  3. Kelly

    Instead of grabbing the server names from a servers.txt file I’d like to use an OU in AD. Something like this:

    $servers = Get-ADComputer -Searchbase ‘OU=Location,OU=Country,DC=subdomain,DC=domain,DC=local’ -Filter {OperatingSystem -Like “*Server*” }


    $servers = @(gc “$dir\servers.txt”)

    My PowerShell Skills are only slightly higher than someone who doesn’t know anything about PowerShell, so please excuse the incorrect syntax (if any?)


    • Hi Kelly,

      You can easily get the servers via the Get-ADComputer cmdlet as you mention. However be aware that this cmdlet returns computer objects and not just the name of the computer. This is important as when you will use the array of computer objects later you will need to refer to the computer object properties that you need such as the name for instance.
      If all you want is to retrieve the server names from an OU you could do something like this:
      Get-ADComputer -Searchbase ‘OU=Location,OU=Country,DC=subdomain,DC=domain,DC=local’ -Filter {OperatingSystem -Like “*Server*” } | select ‘Name’

      Hope this helps.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s