PowerShell -3

In this article let us learn few basic cmd-lets. As mentioned in the first series of the article, PowerShell is very user friendly tool.You need not remember the whole command for any instance, PowerShell has the feature of auto-completion. Just type few letters in the command and press tab . PowerShell returns all the commands starting with that word and you can choose the command you want to execute.

If you are not sure about the command, its syntax and usage, you can always use PowerShell help instantly.

get-help <commandname> — briefs you about the command

get-help <commandname> -detailed  — provides detailed information and usage of the command

get-help <commandname> -examples — just provides the usage with examples

get-help <*database*> — use wild card to search for the commands with a string match

PowerShell also contains list of aliases for few cmdlets/functions. Few examples are given below.

fl – Format-List

ft – Format-tab

– For each

clc – clear content

cls – clear screen

clear – clear host

To view the list of all aliases, functions and cmdlets available in PowerShell, just open powershell and type get-command |more which returns you with all details.

Few simple commands

Show-Eventlog – Opens up event viewer for local computer

Clear – Eventlog – Clears an event log specified

Stop-Computer – Shutdown the computer specified

Test-Connection – Tests connection to a remote computer (alias for ping)

You can also convert the files to a desired format using below conversion commands ConvertFrom-CSV, ConvertTo-CSV, ConvertTo-HTML, ConvertTo-XML etc. Find out more commands using get-help *convert*

In the next articles let us learn how to import different modules, install /add different roles and features to a server.

Link to first article about PowerShell

Link to 2nd article about PowerShell

Active Directory with PowerShell

Happy to to share with all my blog readers that we have authored a book named “Active Directory with PowerShell published by Packt Publishers.

This book acts as a complete guide that will unleash the power of automation in Active Directory environment. Also helps you to

  • Create and manage domains, organization units, sites, and IP subnets using PowerShell
  • Learn advanced operations in Active directory such as promoting, demoting active directory domain controllers, recovering AD objects, and working with replication using PowerShell

Insight

The book starts with an overview of the components, software, and modules required to manage Active Directory with PowerShell. It then moves on to help you create and manage users, computer accounts, and group policies with simple examples to automate daily tasks. Furthermore, it covers topics such as GPOs, DNS Server/Client, DFS-N, and DFS-R automation. It also demonstrates how to automate some advanced operations so that they can be scripted to perform in a faster and more efficient way. By the end of this book, you will be competent enough to use PowerShell to manage your Active Directory environment and will gain all the required knowledge to automate your daily operations.

Take-Aways

  • Manage user and computer accounts using PowerShell
  • Automate group membership additions, removals, and bulk operations using PowerShell
  • Perform various query operations against Active Directory to fetch user, computer, and group details in an efficient and faster way
  • Understand how sites, subnets, and domains are managed
  • Perform advanced operations such as Domain Controller promotion/demotion
  • Discover how to automate replication checks, fine grained password policy creation, and FSMO roles transfer/seize using PowerShell
  • Get to know more about DNS server management, record creation/modification/ deletion, and DNS client management with PowerShell
  • Find out ways to automate DFS-N and DFS-R installation and configuration using PowerShell

How to get this book?

https://www.packtpub.com/networking-and-servers/active-directory-powershell