Not sure how to phrase this

Discussion in 'Training & Development' started by zxspectrum, Oct 29, 2017.

  1. zxspectrum

    zxspectrum Terabyte Poster Forum Leader Gold Member

    2,092
    216
    244
    Ok, bear with me on this as I have no idea how to phrase it.

    As I have been trying, when I can, to get into powershell, i find myself getting confused with wmi, wmic , cim etc, even though I know they sort of sit close together in the world of microsoft. Stuff like .net framework and where would Activve directory sit in all of this. I am not sure if I am makiing sense but thought I would ask

    If anyone has a link or a pic/diagram of where things sit and relate to each other, that would be much appreciated

    Ed
     
    Certifications: BSc computing and information systems
    WIP: 70-680
  2. JK2447
    Highly Decorated Member Award 500 Likes Award

    JK2447 Petabyte Poster Administrator Premium Member

    7,200
    951
    318
    Hi Ed, don't worry about it being confusing, because many of us feel this way so it is always best to admit where you're getting lost, or you'll never find your way. I did a week long course in London on powershell (sometimes referred to as PS or POSH) and had my mind blown. It took another week or two of study and pages of red error messages before the errors became less and less. The Windows Management Instrumentation Command line (WMIC) is the utility that letsyou to perform Windows Management Instrumentation (WMI) operations with a command prompt.

    You need the .net framework to use PS, and this is confusing because there are many threads of info here that all come together before you will understand what it's all about, although its possible to be a good scripter without understanding what's under the hood. PS can manipulate AD and make light of admin tasks such as creating 1000 user accounts or automating server administration.

    You can't go wrong with THIS link from Microsoft that covers the following:

    Get started with Windows PowerShell
    Learn how to use PowerShell.

    Setup and installation
    Get PowerShell installed in your environment.

    Tutorials
    A cookbook of common scripting tasks.

    PowerShell on GitHub
    PowerShell is an open-source project and available for Windows, Linux and macOS.

    Download WMF
    Windows Management Framework contains the latest versions of PowerShell, DSC, WMI, and WinRM for older versions of Windows.

    PowerShell Module Browser
    Search for PowerShell modules and cmdlets.
    Features
    Reference
    Community
    English (United States)

    If you have any issues with a script give me a shout as I'd love to dust off some cobwebs. I don't have to script anymore but I loved it and miss it. Once you're proficient at Poweshell, and if you have VMware infratructure, you need to check out my beloved VMware PowerCLI HERE. VMware automation with PowerCLI is most excellent, saved me many hours, and gave us functionality we previously did not have.

    FYI Powershell Core (like PS 6.0) came out on August 18th 2016. That just so happens to be my birthday.... just saying.... thanks to my mate Billy G:)
     
    Certifications: VCP4, 5, 6, 6.5, 6.7, 7, 8, VCAP DCV Design, VMConAWS Skill, Google Cloud Digital Leader, BSc (Hons), HND IT, HND Computing, ITIL-F, MBCS CITP, MCP (270,290,291,293,294,298,299,410,411,412) MCTS (401,620,624,652) MCSA:Security, MCSE: Security, Security+, CPTS, CCA (XenApp6.5), MCSA 2012, VSP, VTSP
    WIP: Google Cloud Certs
  3. JK2447
    Highly Decorated Member Award 500 Likes Award

    JK2447 Petabyte Poster Administrator Premium Member

    7,200
    951
    318
    Just to add, when you read a bit on powershell, be sure to have a play with it as this is what will cement what is being said. While its all conceptual you will struggle to find those "ah I see what you mean now" moments IMHO
     
    Certifications: VCP4, 5, 6, 6.5, 6.7, 7, 8, VCAP DCV Design, VMConAWS Skill, Google Cloud Digital Leader, BSc (Hons), HND IT, HND Computing, ITIL-F, MBCS CITP, MCP (270,290,291,293,294,298,299,410,411,412) MCTS (401,620,624,652) MCSA:Security, MCSE: Security, Security+, CPTS, CCA (XenApp6.5), MCSA 2012, VSP, VTSP
    WIP: Google Cloud Certs
  4. zxspectrum

    zxspectrum Terabyte Poster Forum Leader Gold Member

    2,092
    216
    244
    Well to be fair to myself, i can do the basics to an extent. I think one thing that really messes me up is other peoples scripting.

    I wanted to rename a load of PCs but didnt want to go round manually and do this, so found a script and worked out how to change what I needed to do. But that was for one PC per time, which was still faster. However I needed to do about 50, where I had to liaise with another guy fom another dept, his script was absolutley massive, like way over the top, which never really helped me whatsoever.

    Cheers for the links though, JK I will look at them and see what I can do.

    I think its fair to say i made one hell of a great decision to get into IT, its not the same old same old every day, it can vary, doing things like this makes it very exciting and interesting, IMO.

    My only problem is, I want to do everything ha ha

    Ed
     
    Certifications: BSc computing and information systems
    WIP: 70-680
    JK2447 likes this.
  5. JK2447
    Highly Decorated Member Award 500 Likes Award

    JK2447 Petabyte Poster Administrator Premium Member

    7,200
    951
    318
    I agree mate, IT is a great line of work, very challenging and keeps your brain ticking over. I think we all strive to know it all but we never will ha ha

    That script you speak of should be quite simple, pulling in a txt file with a list of names most likely. Perhaps his script does more than just that or its a complicated environment. Sometimes people are just overly verbose. I always favored the less is more approach, and always put in plain text to say what each section was doing
     
    Certifications: VCP4, 5, 6, 6.5, 6.7, 7, 8, VCAP DCV Design, VMConAWS Skill, Google Cloud Digital Leader, BSc (Hons), HND IT, HND Computing, ITIL-F, MBCS CITP, MCP (270,290,291,293,294,298,299,410,411,412) MCTS (401,620,624,652) MCSA:Security, MCSE: Security, Security+, CPTS, CCA (XenApp6.5), MCSA 2012, VSP, VTSP
    WIP: Google Cloud Certs
  6. Phoenix
    Honorary Member

    Phoenix 53656e696f7220 4d6f64

    5,749
    200
    246
    I think it's worth noting some of the structure here to better grasp what's going on under the hood

    PowerShell is the Microsoft scripting interface, it's both a language, and a shell, and it's built on top of .NET
    included out of the box with PowerShell are cmdlets that allow you to interface with CIM and WMI
    CIM and WMI for all intent and purpose are the same (but not actually the same, bear with me)
    CIM is an open standard that provides a known management interface for systems, switches, storage devices etc
    WMI is built on top of CIM, it was Microsofts management interface of choice for years and it's still heavily used

    Pretty much all windows systems can be communicated with via WMI or CIM, and most of the newer ones have at least one version of .NET installed

    Now, knowing this we can see that PowerShell can be used in multiple ways
    it can manually talk to individual systems via CIM or WMI if they are properly exposed and configured
    it can be used to craft tools that can reach out to multiple systems at a time via CIM or WMI
    it can be used in other manners that .NET may expose/enable

    Active Directory has it's own PowerShell module that's installed as part of RSAT, so once you have that you can do all sorts of things in the directory directly via PowerShell cmdlet
    things like adding/removing users, resetting passwords etc

    These cmdlets are provided by a PowerShell module, and I believe that specific one is built on native C# code (Modules can be PowerShell or C#)

    Modules expand PowerShells usefulness above all of its 'out of the box' power by providing ready made cmdlets that interface with various other techs (like Active Directory, or Azure, or AWS etc)
     
    Certifications: MCSE, MCITP, VCP
    WIP: > 0
    dmarsh and JK2447 like this.

Share This Page

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.