Remedying Shell Shock Part 3: Automating Your Day




This is the third and final part of our Remedying Shell Shock blog series. Please read Part 1 and Part 2 if you haven’t already before you begin. 

Reworking the Script

Throw out everything you know about scripts while disregarding any fears or anxieties you have around the command-line. Scripting can be easy, fun, and make your life 10x easier the more you use it. Before writing a script you should think of a key objective or goal that you would like to accomplish. Going into writing a script, you should have a clear understanding of what you would like to be able to achieve, then you can go into writing the draft. 

PowerShell executable script files are saved and written with the ps1 file extension. You can then execute these scripts via PowerShell by running the following command in the prompt:

./script_name.ps1

Luckily if you’re just starting with JumpCloud and PowerShell, we have a full GitHub Wiki with all of the commands that you can use to manage your JumpCloud organization. If you leverage these pre-written commands in tandem with your tenant, you could easily compile a script to perform a specific action. 

Imagine you are looking to list all Users without MFA enabled on their accounts, enable MFA on your Users, as well as enabling MFA on a System Group’s systems that do not have it enabled already. This can be done through the UI with several clicks through a few different menus, or could be easily compiled within a script where you can perform both tasks with a singular call.

For example, contents of a script to achieve this could be: 

#Get all Users with MFA disabled on their JumpCloud User Account and enable it#

Get-JCUser -enable_user_portal_multifactor $false | Set-JCUser -enable_user_portal_multifactor $True

#Get all Systems within the All Systems Group with MFA disabled and enable it#

Get-JCSystemGroupMember -GroupName “All Systems" | Set-JCSystem -allowMultiFactorAuthentication $true

Using JumpCloud’s GitHub Wiki, there are a boatload of PowerShell Commands which are pre-written for many of your daily tasks that you could do within JumpCloud. You could either copy and paste these commands straight into the JumpCloud PowerShell Module window, or you could compile several of these commands into executable ps1 script files. 

As JumpCloud builds out more and more of the product, the JumpCloud PowerShell Module is updated so you have the power and flexibility to manage your JumpCloud tenant with a few commands or a few simple scripts. 

Automate Your Day

When it comes down to brass tacks, all admins generally want the same thing. A day where they can hit a few buttons or run a few scripts and be off about their day focusing on higher priority projects or tasks. With automation, leveraging JumpCloud’s PowerShell Module, you can do that with relative ease.

Even if you’re new to the shell world and are not acquainted with scripting, we’ve provided a well written library and wiki within our GitHub page, blogs, and other resources. We believe that a day in the life of an admin shouldn’t be burdensome and littered with dozens of minor tasks. You should be able to execute a task simply within either a few clicks in the Admin Portal or within a simple script using the JumpCloud PowerShell Module. 

If you’re unsure about running certain commands or want to test your scripting before running it in production, we got you! You can simply sign up for a free JumpCloud account with up to 10 users and 10 devices for life today if you haven’t already created one. Use this secondary free account for your testing while leaving your production JumpCloud tenant alone. This flexibility gives you the power to test your scripts in a test environment first before running them in your production environment to ensure your syntax and commands are what you want them to be. 

If you’re interested in understanding more about PowerShell, JumpCloud, or our API, check out the resources below for more details!

Resources

JumpCloud PowerShell Module Wiki

JumpCloud PowerShell Module Command Basics

Sign up for a free JumpCloud Org with 10 users and devices — no credit card required

Evolution of the JumpCloud PowerShell Module

Managing a Cloud Directory with PowerShell

JumpCloud’s API Documentation


Related Posts
Use the new JumpCloud App for Slack to resolve user issues from the same place you communicate with them! Try JumpCloud Free.

Blog

User Administration with the JumpCloud App for Slack

Use the new JumpCloud App for Slack to resolve user issues from the same place you communicate with them! Try JumpCloud Free.

Admins can customize select JumpCloud emails sent to their users to improve and secure the user experience in the cloud directory platform.

Blog

Customize JumpCloud System-Generated Emails With Your Company’s Brand Identity

Admins can customize select JumpCloud emails sent to their users to improve and secure the user experience in the cloud directory platform.

JumpCloud’s password management solution secures end user identities with settings to force password change policy and more. Try JumpCloud Free.

Blog

JumpCloud’s Force Password Change Expands User Identity Management Solution

JumpCloud’s password management solution secures end user identities with settings to force password change policy and more. Try JumpCloud Free.