Author: Arpit Mandliya
- 04 May
Check if AD User Exists in PowerShell
In PowerShell, we must import the ActiveDirectory module to use the Get-ADUser cmdlet. If you have imported it already, you can jump to the Checking If AD User Exists in PowerShell section; otherwise, let’s continue with us step-by-step below. Installing the ActiveDirectory Module To import the ActiveDirectory module, we first need to install it. So, […]
- 04 May
Resolve Device or Resource is Busy Error in Linux
1. Introduction When working with Linux, you might encounter the error message “Device or Resource is Busy” while trying to unmount a filesystem, detach a storage device, or perform operations on files or directories. This error indicates that the target you’re trying to operate on is currently in use by the system or a process, […]
- 03 May
Get Logged on Users in PowerShell
This topic can be interpreted as getting all current logged-on users and retrieving one logged-on user in PowerShell. Let’s learn both interpretations. 1. Introduction to the Problem Statement In network and system administration, it’s often necessary to determine which users are currently logged on to a system. This information can be critical for security, auditing, […]
- 03 May
Bash Create Folder if Not Exists
To run the following commands, directly write the command in the bash terminal and execute them. Using mkdir -p Command Use the mkdir -p command to create folder if not exists in Bash [crayon-676856ba58801167566739/] The mkdir is used to create the directory. The -p created all the intermediate directories if they didn’t exist. The /path/to/directory […]
- 03 May
Append Data to File using PowerShell
Appending Text to a Text File We have various approaches to append content in a text file using PowerShell. For example, we can append information on the same line, on a new line with/without special characters, on multiple lines, and append formatted data such as tabular content. But, before moving towards possible solutions, it is […]
- 02 May
Check if Arguments Exists in PowerShell
In PowerShell, it is essential to check whether arguments exist, especially when creating scripts that take input parameters. However, before delving into the specifics of developing a PowerShell script that accepts arguments and checks for their presence, learning how to create a script .ps1 file within a directory is essential. You need to go through […]
- 02 May
If Not Condition in Bash
In Bash, figuring out how you interpret the term if not condition before digging into the solutions is mandatory. For example, are you taking as negating the condition/expression, which means make the condition/expression False if it is True and vice versa? Or, you want to make some comparisons to assess inequality; this comparison can be […]
- 02 May
Combine Multiple Conditions in if Statement in PowerShell
We use an if statement with logical operators and comparison operators to combine multiple conditions in PowerShell. We also use parentheses represented by (()) to group conditions and control the evaluation order. So, it is essential to know what logical, arithmetic and comparison operators we have, what they mean and what they can do. See […]
- 27 April
Convert String List to Integer List in Python
Using map() Method Use the map() method with list() method to convert string list to integer list in Python. [crayon-676856ba591de905635423/] [crayon-676856ba591e1226330098/] First, we defined a variable named string_list and set its value to a list having five string values. Next, we used the map() method, which applied the int() method to every element in string_list […]