How to manipulate Excel files with PowerShell

No one can deny that Excel is a daily use application even for IT guys, it’s one skill that you cannot avoid or skip without having and using. To generating reports as an excel file or you can say presenting PowerShell object properties as excel file -Not .CSV- is very helpful specially with AD and Exchange, for example creating bulk

Read More

WMI -VS.- CIM

what is WMI and CIM ? WMI Stands for “Windows Management Instrumentation” , which is Microsoft’s implementation of the CIM or “Common Information Model” which is a standard from DMTF or “Distributed Management Task Force” this is simply provides common definition of management information for systems,networks,applications, and services. the standard includes a Specification, Schema, and meta-models that allow vendors to

Read More

PowerShell Remoting

the point of depending on PowerShell to complete your administrative tasks, is that you can accomplish lots of things at once, and without the ability to manage multiple servers from once central location, the whole thing seems useless. so with the below information we will show how PowerShell is a perfect tool to manage remote machines. PowerShell remoting gives this

Read More

Serialization

Serialization is : the process that allows us to kind of save the object usually to a file typical formats of the files are CSV or XML. Serialized objects can be recreated from these source files and create the same objects as they were before serializing CSV: Stands for Comma separated Values Most commonly used format Default Delimiter is a

Read More

Working with Objects

Object Oriented Terminology: In this example to understand the basic terminology we will use the classic example of building a house. At its basic level a Class is a basic equivalent to setup a blueprints a builder will use in order to construct a new house. In a typical blueprint you will have things that will describe what are you

Read More

Advanced Concepts

Security – Execution Policy: Security is based on execution policy which we can get by Get-Execution polity There are four possible values for execution policy : Restricted    : no scripts can be run. User can only use PS interactively AllSigned     : All Scripts must be code signed RemoteSigned  : All Scripts marked as unsafe ( i.e downloaded from    

Read More

Functions & Modules

Functions: Functions are basically script block with names: To create a function we use the keyword function follow with the name of the function then () which will hold the parameters. Function Write-HelloWorld() { Clear-Host “hello World” } # running this will places the function in memory for us to use. To execute the function we simply write the name of

Read More

PowerShell Program flow

Logic Barnching: If/else: $var = 2 If ($var -eq 1) { Clear-Host “If Branch” } Else { Clear-Host “else Branch” } If /elseif /else: If ($var -eq 1) { Clear-Host “If -eq 1 Branch” } Elseif ($var -eq 2) { Clear-Host “Elseif -eq 2 branch” } Else { Clear-Host “else branch” } Switch Statement for multiple conditions: To evaluate one

Read More

Strings, Arrays, and Hash Tables

Basic Strings: String Quoting: Any string should go between “”  in some cases we need to include ” within our string and this will be like below : “String goes here “”text”” the rest of the string” The output of this is     String goes here “text” the rest of the string The same way with single quote ‘ ‘String goes

Read More

Variables in PowerShell

Introduction to Variables: All Variables start with a $ symbol like the below simple assignment $Hi = “Hello World” Note: when using spaces in the name of the variables you have to put the name between “” and the = symbol is for assignment.   $Hi # to print the Value of the variable Write-Host $Hi   # this is the

Read More