RSS

Tag Archives: ICT

PowerShell – Get-EnumValue function to get possible values of properties / attributes

PowerShell – Get-EnumValue function to get possible values of properties / attributes

In my previous blog post I blogged about how to get the possible values of an attribute or property like by example the service starttype using enumerators.

For future use I’ve created this function called Get-EnumValue. The function (and any updated future versions) can be found on ScriptCenter: https://gallery.technet.microsoft.com/scriptcenter/Determine-possible-values-eaf48782

But for those that don’t want to click and just want to see the current version, here it is:

Function Get-EnumValue

{

    <#

    .SYNOPSIS

        Determine possible values of a property / attribute of the [system.enum] type

        By example the possible values of startup type of a service.

    .DESCRIPTION

        Determine possible values of a property / attribute of the [system.enum] type

        By example the possible values of startup type of a service

 

        In some cases this can easily be determined if there is a “set-” version of the cmdlet.

        By example with Get-Service, there is also a Set-Service where the StartUpType values can be determined using “Get-Help Set-Service -Full” or by simply typing: Set-Service -StartupType and using auto completion.

 

        In some cases this is however not possible and this function can be used.

    .PARAMETER EnumProperty

        Input a property of the [System.enum] type. By example: (Get-Date)[0].DayOfWeek or (Get-Service)[0].StartType’)    

    .EXAMPLE

        $FormatEnumerationLimit=-1

        $Property1 = (Get-Date)[0].DayOfWeek

        $Property2 = (Get-Service)[0].StartType

        Get-EnumValue -EnumProperty $Property1,$Property2

            

        Description

    

        ———–

    

        Set $FormatEnumerationLimit to -1 to prevent cutoff of the results.

        Store 2 properties in variables and use the Get-EnumValue function with the named parameter -EnumProperty to enumerate their values.

    .EXAMPLE

        $FormatEnumerationLimit=-1

        Get-EnumValue -EnumProperty (Get-Date)[0].DayOfWeek,(Get-Service)[0].StartType

            

        Description

    

        ———–

    

        Set $FormatEnumerationLimit to -1 to prevent cutoff of the results.

        Use the Get-EnumValue function with the named parameter -EnumProperty to enumerate their values without first storing them in variables.

    .EXAMPLE

        $FormatEnumerationLimit=-1

        $Properties = @((Get-Date)[0].DayOfWeek,(Get-Service)[0].StartType)

        Get-EnumValue -EnumProperty $Properties

            

        Description

    

        ———–

    

        Set $FormatEnumerationLimit to -1 to prevent cutoff of the results.

        Store 2 properties in a single array and use the Get-EnumValue function with the named parameter -EnumProperty to enumerate the values of the properties in the array.

    .EXAMPLE

        $FormatEnumerationLimit=-1

        (Get-Date)[0].DayOfWeek,(Get-Service)[0].StartType | Get-EnumValue | Format-Table    

    

        Description

    

        ———–

    

        Set $FormatEnumerationLimit to -1 to prevent cutoff of the results.

        Put 2 properties in the pipeline and pipe them to Get-EnumValue to get their values.

    .NOTES

        1) By default, the EnumValues are truncated like this for format-list, format-table, etc:

 

        For Format-List:

 

        TypeName   : System.DayOfWeek

        EnumValues : {Sunday, Monday, Tuesday, Wednesday…}

 

        TypeName   : System.ServiceProcess.ServiceStartMode

        EnumValues : {Boot, System, Automatic, Manual…}

 

        For Format-Table:

 

        TypeName                               EnumValues                            

        ——–                               ———-                            

        System.DayOfWeek                       {Sunday, Monday, Tuesday, Wednesday…}

        System.ServiceProcess.ServiceStartMode {Boot, System, Automatic, Manual…}

 

        By setting $FormatEnumerationLimit to -1 all values will be shown (https://blogs.technet.microsoft.com/heyscriptingguy/2011/11/20/change-a-powershell-preference-variable-to-reveal-hidden-data/):

        $FormatEnumerationLimit=-1

 

        2) This example uses [Enum]::GetValues but it can easily be modified to use [Enum]::GetNames

 

        3) Additional information and resources:

        http://social.technet.microsoft.com/wiki/contents/articles/26436.how-to-create-and-use-enums-in-powershell.aspx#UsingEnumsWiithFunction

        https://msdn.microsoft.com/en-us/library/system.enum.getnames(v=vs.110).aspx

        https://msdn.microsoft.com/en-us/library/system.enum.getvalues(v=vs.110).aspx

#>

    [CmdletBinding()] #Provides advanced functionality. For more details see “What does PowerShell’s [CmdletBinding()] Do?” : http://www.windowsitpro.com/blog/powershell-with-a-purpose-blog-36/windows-powershell/powershells-%5Bcmdletbinding%5D-142114

    Param

    (

        [Parameter(Mandatory=$true, #Parameter is mandatory.

                   ValueFromPipeline=$True, #Allows pipeline input.

                   Position=0, #Allows function to be called without explicitly specifying parameters, but instead using positional parameters in the correct order

                   HelpMessage=‘Input an object of the [System.enum] type. By example: (Get-Date)[0].DayOfWeek or (Get-Service)[0].StartType’)] #Enter a help message to be shown when no parameter value is provided.

        [ValidateNotNullOrEmpty()] #Validate the input is not NULL or empty

        [ValidateScript({$_ -is [System.Enum]})] #Validate whether or not the input is actually of the [System.enum] type.

        [System.enum[]]$EnumProperty

    )

    BEGIN

    {

    }

    PROCESS

    {

        $Output = @()

        Foreach($object in $EnumProperty)

        {

            TRY

            {

                $TypeName = ($object | Get-Member)[0].TypeName

                $EnumValues = [Enum]::GetValues($TypeName) #Pre-PowerShell 3.0

                $ObjectEnumResult = New-Object PSCustomObject -Property @{

                ‘TypeName’ = $TypeName

                ‘EnumValues’ = $EnumValues

                }

                $Output += $ObjectEnumResult

            }

            CATCH

            {

                Write-Verbose “Error occurred processing $object

            }

            FINALLY

            {

            }

        }

 

        #Send output to the pipeline

        $Output

    }

    END

    {

    }

}

 

 
1 Comment

Posted by on March 11, 2016 in Automation, ICT, Microsoft, Powershell

 

Tags: , , , , , , , , , , , , , ,

Free PowerShell Desired State Configuration (DSC) training on February 25th and 26th

Microsoft Virtual Academy (MVA) is hosting 2 PowerShell Desired State Configuration (DSC) training classes on February 25th and February 26th:

  1. Getting Started with PowerShell Desired State Configuration (DSC)
  2. Advanced PowerShell Desired State Configuration (DSC) and Custom Resources

The links above provide include a course outline and a link to register for the Jump Start. And even if you can’t join live, the recordings will always be made available at a later time so you can watch whenever it suits you better.

PowerShell DSC is becoming increasingly important and I personally also still need to learn more about it and look forward to it.

I hope it’s useful to you as well.

 

Tags: , , , , , , , , , , , , ,

Book review : Cloud Computing Concepts, Technology & Architecture

CCCTA_cover

Title: Cloud Computing Concepts, Technology & Architecture
Number of pages: 
528
ISBN: 9780133387520
Released
May 2013

My opinion:

The book is well written, is vendor neutral, covers both business and IT aspects and contains many great diagrams. It also has a lot of useful references to external resources.
What I disliked, is that because of the vendor neutral approach some aspects are relatable enough (especially for people that don’t have a lot of working experience). I feel the book would have benefitted by providing more real-life examples of products or services.

The book is a good start for experienced people and will especially come in handy as a reference when getting involved in cloud computing projects. It will help understand vendor specific products and services better.

I would recommend people that are new to cloud computing (or that have very limited working experience) to first read a cloud essentials book like the one from Sybex before reading this book though.

To take a look at the book and its content, you can visit the book’s companion website: http://servicetechbooks.com/cloud

 

Tags: , , , , , , , , , ,

Book review : Cloud Essentials – CompTIA Authorized Courseware for Exam CLO-001

9781118408735 cover.indd

Introduction

For those who haven’t read my previous blog posts, here’s a short summary. About 1,5 – 2 years ago I decided that I wanted to know more about cloud computing and get certified as well. I used freely available resources to attain these certifications:

In short, my conclusion was that the quality of the freely available resources were not sufficient. ITpreneurs were kind enough to provide me with access to their e-learning course and Train Signal (now Pluralsight) provided me with their video training. Reviews for both can be found here:

Even though both resources are good, I personally prefer a book over eLearning and video training. As such I picked up a copy of “Cloud Essentials : CompTIA Authorized Courseware for Exam CLO-001

Review

Number of pages: 268
ISBN: 978-1-118-40873-5
Released
: June 2013

My opinion:

The book is well written and knows to provide a very good basis of cloud computing both technical and non-technical. Even though the number of pages is limited, the most important aspects are covered in my opinion, which should be enough to provide insight and to pass the Exin and Comptia cloud exams.

What I disliked are some of the questions at the end of the book, because they are sometimes a bit strange. But as far as I can remember, this was also the case in the official exams … so better get used to it if you are going to get certified.

All in all, this is a very good book to get started with cloud computing.

 

 
1 Comment

Posted by on July 15, 2014 in Cloud, ICT, Learning, Private cloud, Public Cloud

 

Tags: , , , , , , , , , , , , , , , , , , , , ,

ICT – Great article by Paul Simoneau about ICT challenges including suggestions to deal with them

As an ICT professional I believe working in ICT can be very challenging. Paul Simoneau wrote a great article about current and future challenges including suggestions to deal with them.

The challenges covered in the article are: new technology, cloud, big data analytics, virtualization, Bring Your Own Device/Apps (BYOD/BYOA), shadow IT, new generations of workers, energy  efficiency, user systems, creating value, interoperability and social networks.

I wanted to share this article because I feel it reflects reality very well.

 

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Cloud – ITpreneurs CCC Professional Cloud Solutions Architect course

At the beginning of September I had the opportunity to attend the first ever Cloud Credential Council (CCC) Professional Cloud Solutions Architect (PCSA) course from ITpreneurs. The trainer was Mark Skilton and I really loved the training. But before telling you more about my experience, I’ll first first explain both the certification and the course in a bit more detail.

What is the CCC Professional Cloud Solutions Architect (PCSA) certification and who is it for ?

The PCSA certification is a globally recognized certification for technology architects. Solution Architects need to understand the impact that cloud is having on business and information architecture, application design, data management and security architecture and be very familiar with the topology and ecosystems that are being created as a result of increasing adoption of cloud technologies and operating models The certification is designed for senior technology professionals who are architecting and designing the future generation of technology solutions. Being PCSA-certified showcases your cloud architecting experience, skills and knowledge, and demonstrates you are capable to manage the various stakeholders within the enterprise. For more information, please take a look at the website: http://www.cloudcredential.org/en/certifications/professional-level/cloud-solutions-architect

What is the ITpreneurs CCC Professional Cloud Solutions Architect (PCSA) course ?

The ITpreneurs CCC PCSA course is a 3-day instructor led course that provides attendees with the required knowledge and skills for the CCC Professional Cloud Solutions Architect (PCSA) certification. The course material was created by lead author Mark Skilton and peer reviewers Vladimir Baranek and RajaGopalan Varadan. For more information, contact ITpreneurs and/or take a look at the course description: http://www.itpreneurs.com/cloud/CCC-courses/cloud-solutions-architect-VCC1310-itpreneurs.pdf

My experiences with and opinion about the ITpreneurs CCC PCSA course

Like I said at the beginning, I really loved the CCC PCSA course because:

  • It covers an important current topic that I believe will become even more important in the future.
  • The course materials are very complete and of great quality.
  • There’s a good balance between theoretical and practical knowledge.
  • The cases are mini workshops that force you to apply your knowledge, which provides more insight. They are also consistent with cases from previous cloud courses from ITpreneurs.
  • There is a lot of interaction between the trainer and the students.
  • Mark Skilton presented the course with a lot of enthusiasm and modified the course content on the go to focus more on the interests of the audience. 

One of the difficult parts of cloud computing is that it’s a very broad definition. As such, different interpretations and explanations are used for the same word/technology by different people and companies. So during the course there were some discussions. I thought this was good, because this will happen in real-life as well. It also stresses the importance of clear definitions and verifying correct understanding of all involved parties.

The special version of the course I attended was only two days, while the regular course will be three days. Since there was so much information to take in and because there were many discussions, the two days unfortunately weren’t enough to cover everything. ITpreneurs and Mark Skilton modified the course on the fly to cover the most important things, but I would have loved to go into more detail during the course if there had been time. Unfortunately this wasn’t the case, but since the course materials are of great quality I’ll be reading them at home instead.

As always there’s room for improvement. Our class provided a lot of feedback that Mark Skilton and ITpreneurs took to heart. They seemed to be really committed to improving the course so I expect the course to become even better since the course materials are currently being reassessed and restructured.

I hope you enjoyed reading about my course experience. For those interested in it, I added some more information about ITpreneurs and the Cloud Credential Council at the end of this blog post.

Thanks

I’d like to thank Corjan Bast and ITpreneurs for providing me with the opportunity to attend this course free of charge. I also want to thank Mark Skilton and all other great people involved in this course for their participation, valuable input and hard work.

Read the rest of this entry »

 
 

Tags: , , , , , , , , , , , , , , , , ,

Powershell – Recording of ‘The Case for PowerShell: Why To Learn-PowerShell So You Needn’t Leave-Industry’

Last week Mark Minasi presented a webinar made possible by http://www.learnit.com called:
“The Case for PowerShell: Why To Learn-PowerShell So You Needn’t Leave-Industry”.
The recording can be found here.

In this webinar he explains why ICT administrators need to be(come) familiar with PowerShell. He also explains the basic principles of PowerShell to help lower the threshold for people that have been shying away from command line interfaces (CLI) and scripting in the past. He does this by explaining how PowerShell is different from by example the CLI and Visual Basic Scripting (VBS).

I share his opinion about the necessity to learn PowerShell and therefore I hope I can help spread the message.

You can keep track of Mark Minasi by following him at Twitter: https://twitter.com/mminasi (@mminasi).

 
Leave a comment

Posted by on September 11, 2013 in Uncategorized

 

Tags: , , , , , , , , , , , , , , , ,

Microsoft – RTM versions of Windows 8.1 and Windows Server 2012 R2 now available for MSDN and Technet subscribers

Even though it seemed for a while that MSDN and Technet subscribers would not get early access to the latest Windows versions, Microsoft decided to listen to customer feedback and reconsidered.

As a result, they just made the RTM versions of Windows 8.1 and Windows Server 2012 R2 available for MSDN and Technet subscribers. General availability for both Windows 8.1 and Windows Server 2012 R2 is still October 18. For the official statement, read this blog post.

Personally I’m very stoked about Server 2012 R2 and I’m already running the preview version. I especially love the improvements on Hyper-V and de-duplication. For more information about new and improved functionality, take a look at the free e-book : Introducing Windows Server 2012 R2 Preview Release.

 
Leave a comment

Posted by on September 9, 2013 in Uncategorized

 

Tags: , , , , , , , , , ,

Microsoft – Troubleshooting Key Management Service (KMS) activation

Today I helped a colleague troubleshoot a couple of systems were unable to activate using Key Management Service (KMS). Basically for this situation it boiled down to this:

Determine for the KMS service

  1. Which server is hosting the KMS service.If an SRV record has been added for KMS DNS auto discovery, run from CMD: nslookup -type=srv _vlmcs._tcp
  2. If the server hosting the KMS is functioning correctly:
  • Check if the server is up and running.
  • Check if the “Software Protection” service (sppsvc) is running.
  • Verify if the KMS service is listening on port 1688: telnet localhost 1688
  • Verify the KMS status. Run from CMD: slmgr.vbs /dli
  • Verify if a KMS key is installed and activated.
  • Verify if the minimum threshold for activation is being met.
  • Verify if other clients are able to activate using KMS. Even though the output of “slmgr.vbs /dli” gives you an indication, you can use the “Volume Activation Management Tool” (VAMT) for more insight and functionality.
  • Verify that a VLK key is being used.

For clients that are not able to activate

  • Verify if the correct KMS server can be resolved correctly:
    nslookup -type=srv _vlmcs._tcp
  • Verify if the KMS can be contacted:
    telnet <KMS FQDN or IP> 1688

    •  If this is not the case, perform a traceroute to determine potential causes. Reasons could include:
      • No default gateway configured on the client to reach the KMS.
      • No route configured on the client to reach the KMS.
      • Firewall on the client is blocking the traffic.
      • Firewall on the server is blocking the traffic.
      • If it is a VM, the virtual network might be misconfigured.
      • Routing on the network is not correct.
      • Firewall on the network is blocking traffic.
  • Clear any previous (mis)configuration: slmgr.vbs /ckms
  • Attempt activation: slmgr.vbs /ckms

NOTE: If you have lots of systems where you need to clear configuration and then attempt activation, you can also perform slmgr.vbs on remote computers using:
slmgr.vbs TargetComputerName [username] [password] /parameter [options]

Additional information

If you haven’t been able to resolve the issue, you might want to take a look here:

 

Tags: , , , , , , , , , , , , , , , , , , ,

TechNet subscriptions will be retired, last week to get or renew a subscription.

As you might have already read by now in my previous post, TechNet subscriptions are going to disappear. For more info take a look at this blog post and the Subscriptions retirement FAQ.

This is just a reminder that you have until August 31 to buy a last year of technet.

You might also want to backup existing keys and files:
http://www.zdnet.com/five-things-every-technet-subscriber-needs-to-do-before-time-runs-out-7000017687/

 
Leave a comment

Posted by on August 25, 2013 in Network, Windows 2012

 

Tags: , , , , ,