Scripting

teknologikalteknologikal Member Posts: 12 ■□□□□□□□□□
Very quick question. Just curious right now
I love computers, servers, networking, etc., but the very idea of programming\scripting makes me want to flip burgers for minimum wage =)

I am studying for a number of certifications, but I also understand that as I move along my IT career path, some programming will be required. My question is how much and how hard is it? I've learned 3 spoken languages besides my native language, but these are spoken languages and I have no program with that type of learning. I learn new languages fast. But when it comes to programming languages, I look at examples and think to my self, "WTF am I looking at?" and realize that I simply don't think I can learn it. It's either not for me, it's too complicated, or I am just not cut out of scripting.

Anyone had any experience with learning scripting from absolutely not knowing a single thing about it? Is is possible to learn and how much of it will I need if I am planning to take my career to either fully into networking or perhaps into virtualization?


Thank you!

Comments

  • TheFORCETheFORCE Member Posts: 2,297 ■■■■■■■■□□
    Google has scripts for learning scripts, in other words, there will be many times where you need to do something that someone had already done before you.
  • OctalDumpOctalDump Member Posts: 1,722
    So, what normally happens is that you find yourself doing things with cumbersome GUIs and then discover that there are some quick and easy command line alternatives. Or that implementing some slightly nonstandard or advanced feature requires the command line. You then find you are spending more and more time at the command line. You then realise that some of the tasks you are performing are repetitive, so you keep a bunch of commands that you can hand alter quickly and paste into a shell. Then next step is wondering if you can skip some of that hand altering. So you might start using variables in your commands, things like $HOSTNAME or something.

    From there, there are two big things that you might start doing: loops and conditionals. So, do this thing x times (perhaps slightly differently each time) or do this thing if this condition is true and that thing if it is false.

    Basically it is an evolutionary thing that is always about making your job easier.

    If you've not touched any programming, then I'd recommend learning the absolute fundamentals somehow. Python and JavaScript are both good options for this. Iterations, variables, arrays, if/then, while, defining functions and some other small things. These fundamentals are pretty consistent across scripting languages, so once you understand it in one language, it isn't so hard to understand in another.
    2017 Goals - Something Cisco, Something Linux, Agile PM
  • GSXR750K2GSXR750K2 Member Posts: 323 ■■■■□□□□□□
    It all comes down to being an effective manager. Computers and serves are your workforce, tell them what you want and let them do the work.

    Since you're in the MCSA/MCSE forum, I feel I must mention PowerShell. Microsoft is integrating PowerShell into everything, so not only is it a great way to write object oriented scripts, it is also becoming a standard management tool. Scripting and programming share a ton of similarities and concepts, but one is a convenient way for you to do your job better, the other will drain your soul until you're a withering corpse hunched over a keyboard.

    A script can be one or just a few lines long. For example:

    $dirs = GCI -Path D:\ -Recurse | Where { $_.Attributes -eq "Directory" }

    foreach ($dir in $dirs)
    {
    $acl = (Get-Acl -Path $dir.FullName).Access | Where { ($_.IdentityReference -match "S-1-5-*") }

    if ($acl.IsInherited -eq $false)
    {
    Write-Host $dir.FullName

    }
    }


    That is a quick and dirty way in PowerShell to find all of the uninherited orphaned SID ACEs on D: of a server (the remnants of an account that was deleted but no one bothered to clean up the uninherited NTFS permissions). And it only takes the addition of a "Set-ACL" command with a switch or two to find AND delete the orphaned ACEs, and you didn't have to browse a single folder.

    As far as the management side goes, on Exchange server if you want to know who John Doe emailed in February you fire up the Exchange PowerShell console and...

    Get-MessageTrackingLog -Sender "jdoe@work.com" -Start "02/01/2016" -End "02/29/2016"

    Just remember, scripting is a tool, and like any tool it is only as effective as you can make it. PowerShell, VBScript, JavaScript, or whatever...if you don't like it and don't want to do it, then you'll be doing things by hand all weekend while your buddies are partying at the lake. It's also a good way to look good in front of your boss..."What's that, you finished that on all 2000 servers? Here's a raise..."

    -EDIT-
    My formatting got borked a little, but you get the idea.

    -EDIT 2.0-
    You mentioned networking and virtualization, well PowerShell 5.0 (comes with Win10, can be installed on Server 2012) has a Software Defined Networking module built in for use with Hyper-V, maybe others too:

    Function Name
    Disable-NetworkSwitchEthernetPort
    Disable-NetworkSwitchFeature
    Disable-NetworkSwitchVlan
    Enable-NetworkSwitchEthernetPort
    Enable-NetworkSwitchFeature
    Enable-NetworkSwitchVlan
    Get-NetworkSwitchEthernetPort
    Get-NetworkSwitchFeature
    Get-NetworkSwitchGlobalData
    Get-NetworkSwitchVlan
    New-NetworkSwitchVlan
    Remove-NetworkSwitchEthernetPortIPAddress
    Remove-NetworkSwitchVlan
    Restore-NetworkSwitchConfiguration
    Save-NetworkSwitchConfiguration
    Set-NetworkSwitchEthernetPortIPAddress
    Set-NetworkSwitchPortMode
    Set-NetworkSwitchPortProperty
    Set-NetworkSwitchVlanProperty
  • MeanDrunkR2D2MeanDrunkR2D2 Member Posts: 899 ■■■■■□□□□□
    Learn and know Powershell inside and out. It's actually pretty simple to use once you've played with it a bit. I use it nearly everyday in my role and it's perfect for our needs. There are numerous places to learn more about powershell and how to really become an expert with it. If you know that, you'll have it made.
Sign In or Register to comment.