Add User to Local Administrators Group Using PowerShell

Chirag Nagrekar
Updated on 04-Nov-2023 01:25:40

44K+ Views

To add the AD user or the local user to the local Administrators group using PowerShell, we need to use the Add-LocalGroupMember command.To add the local user to the local Administrators group, Add-LocalGroupMember -Group Administrators -Member TestUser -VerboseThe above command will add TestUser to the local Administrators group. You can provide any local group name there and any local user name instead of TestUserYou can also add the Active Directory domain user to the Local Administrators group by providing the domain name if the computer is in the same domain.For example, we will add the Beta user from the AutomationLab ... Read More

Apply Offset on Current Time in Python

Rajendra Dharmkar
Updated on 04-Nov-2023 01:13:51

4K+ Views

Whenever you want to add or subtract(apply an offset) to a date/time, use a datetime.datetime(), then add or subtract datetime.timedelta() instances. A timedelta object represents a duration, the difference between two dates or times. The timedelta constructor has the following function signature − datetime.timedelta([days[, seconds[, microseconds[, milliseconds[, minutes[, hours[, weeks]]]]]]]) Note − All arguments are optional and default to 0. Arguments may be ints, longs, or floats, and may be positive or negative. You can read more about it here − https://docs.python.org/2/library/datetime.html#timedelta-objects Example An example of using the timedelta objects and dates − import datetime old_time = datetime.datetime.now() print(old_time) ... Read More

Attributes and Types of Attributes in DBMS

Bhanu Priya
Updated on 04-Nov-2023 00:30:34

28K+ Views

Attributes are the properties which describe an entity. Example The attributes of student entity are as follows − Roll number Name Branch Age Types of attributes The different types of attributes are as follows − Composite attribute It can be divided into smaller sub parts, each sub part can form an independent attribute. For example −     ... Read More

Count Lines in a File using Linux Bash

Satish Kumar
Updated on 03-Nov-2023 21:47:56

52K+ Views

Overview We sometimes need to determine how large or small a particular text document is. For example, if we're trying to figure out how long a certain email message is, we might use the number of lines in that message to help us estimate its size. Linux has several different methods for determining the length of a text document. We’ll take a closer peek at some of the most common ways of calculating the number of lines in a specific file. Setup For this quick tutorial, we’ll be using a text file called “programing.txt” which has some of the most ... Read More

Difference Between JFET and MOSFET

Manish Kumar Saini
Updated on 03-Nov-2023 21:44:35

28K+ Views

There is a category of transistors called Field Effect Transistor (FET). In this category, a lot of field effect transistors are there like Junction Field Effect Transistor (JFET), Metal Oxide Field Effect Transistor (MOSFET), Metal Semiconductor Field Effect Transistor (MSFET), etc. In this article, we will compare and contrast the various features of JFET and MOSFET.What is JFET?JFET stands for junction field effect transistor. The JFET is a three terminal semiconductor device and the terminals are: Source (S), Drain (D) and Gate (G). JFET has a channel between source and drain. The channel is the path between the source and ... Read More

Difference Between Synchronous Motor and Induction Motor

Kiran Kumar Panigrahi
Updated on 03-Nov-2023 21:41:21

42K+ Views

A motor in general is an electrical machine that converts electrical energy into mechanical energy. Electric motors can either be DC Motors or AC Motors, depending on the type of power supply that is supplied as its input.AC motors are further classified into two types−Asynchronous or Induction MotorSynchronous MotorA synchronous motor always runs at synchronous speed, while an induction motor runs at a speed less than the synchronous speed.Read through this article to find out more about synchronous motors and induction motors and how they are different from each other.What is a Synchronous Motor?A synchronous motor is a type of ... Read More

Testing of Transformer: Type Tests, Routine Tests, and Special Tests

Manish Kumar Saini
Updated on 03-Nov-2023 21:34:07

30K+ Views

An electrical transformer is tested at the transformer manufacturer premises and at the consumer’s site and also periodically in regular and emergency basis during its service life to confirm its specifications and performance.Types of Transformer TestsTests of transformer done at the manufacturer’s premises −Type testsRoutine testsSpecial testsTests of transformer done at the consumer’s site −Pre-commissioning testsPeriodic testsEmergency testsType Tests of TransformerThe type tests of a transformer are performed at the manufacturer’s premises to prove the design expectations and consumer’s specifications. The type tests are performed in a prototype unit, not in all manufactured units and these tests confirm the basic ... Read More

Instruction Codes and Operands in Computer Architecture

Ginni
Updated on 03-Nov-2023 21:32:00

47K+ Views

A computer instruction is a binary code that determines the micro-operations in a sequence for a computer. They are saved in the memory along with the information. Each computer has its specific group of instructions.They can be categorized into two elements as Operation codes (Opcodes) and Address. Opcodes specify the operation for specific instructions. An address determines the registers or the areas that can be used for that operation. Operands are definite elements of computer instruction that show what information is to be operated on.It consists of 12 bits of memory that are required to define the address as the ... Read More

Difference Between Series Resonance and Parallel Resonance

Manish Kumar Saini
Updated on 03-Nov-2023 21:27:40

47K+ Views

In an AC electric circuit, when the capacitive reactance is balanced by the inductive reactance at some given frequency, then this condition in the circuit is referred as resonance. The frequency of the supply voltage at which resonance occurs in the circuit is called resonant frequency. At the resonance in the circuit, the reactance of the capacitor and inductor cancel each other. Also, at the condition of resonance, no reactive power is taken from the source.Based on the arrangement of capacitor and inductor in the electric circuit, the resonance is divided in two types viz. −Series resonanceParallel resonanceIn this article, we ... Read More

Count Total Number of Lines in a File using PowerShell

Chirag Nagrekar
Updated on 03-Nov-2023 21:24:10

35K+ Views

To count the total number of lines in the file in PowerShell, you first need to retrieve the content of the item using Get-Content cmdlet and need to use method Length() to retrieve the total number of lines. An example is shown below.Example(Get-Content D:\Temp\PowerShellcommands.csv).LengthOutputPS C:\WINDOWS\system32> (Get-Content D:\Temp\PowerShellcommands.csv).Length 5727

Advertisements