Using Powershell Demo
Using Powershell Demo
In this demonstration we'll show a quick overview of PowerShell, a tool that simplifies the management of Windows systems.
With its commands, called cmdlets, pronounced as commandlets, you can easily interact with machines within the domains, access Active Directory to create users, set group policies, and monitor status and settings of Windows services on remote machines.
This is a Windows 2012 Server desktop. We'll start the PowerShell Integrated Scripting Environment as Administrator by right-clicking on the PowerShell icon on the tool bar. This opens the Integrated Scripting Environment, or ISE, for displaying and executing the cmdlets and scripts.
Currently we have a script pane open on the upper left-hand corner, a console pane below that, and the command add on pane on the right.
We can type commands directly into the console pane, just like a command prompt. PowerShell implements Unix-like commands such as 'ls'.
This shows a list of directories under C:\Users. The list below the
Page 1 of 5
command name box shows a list of cmdlets starting with 'Get-D'. By selecting Get-Date, the box shows the list of parameters related to the Get Date cmdlet.
The bottom of the command add on pane shows three buttons-- Run, Insert and Copy-- for performing related operations on the selected cmdlet.
Click the Run button. The console pane shows the result of Get-Date. In the dropdown menu of the Display Hint Parameter select the Time Only option. Click the Run button again. The console panel now shows the results of Get-Date, DisplayHint, Time, with only the time listed.
While you're typing in the command, the PowerShell console panel will popup related attributes or choices of the command, based on its syntaxsensitive edit feature.
Here we observe a list of attributes associated with the framework server object. Choose Children in the menu to complete the selection.
A long list of Windows objects associated with domain controllers is listed. The list of objects produced by the cmdlet can be piped into PowerShell for filtering and processing. Using this powerful feature, we can filter the results of the server children command so we only see users.
Page 2 of 5
Now we will demonstrate the use of the PowerShell script. First we must enable execution of scripts by changing the execution policy.
Note that the script pane can be used as an editor to display the PowerShell scripts and related data files.
Now let's open a User List file. SEI UserList.csv is a comma delimited list. The file includes user's full name, username, password, group- specific group policy, GPO permission, and built-in group.
Here are the details of individual users. There are six users we want to add to the domain.
Now let's open the PowerShell script, which will read in this .csv UserFile. Add the users into Active Directory and set up the proper group permissions.
The script 'addnewuserv2.ps1' will read in credentials to access the Active Directory service.
The first line reads in the administrator credentials. The second line connects to Active Directory. The third line imports the users from the list. Lines 4 through 16 add the user. Line 17 closes the connection to Active Directory.
Now let's execute the script. Click on the Run button or green arrow on the toolbar to run the script.
Page 3 of 5
Let's verify the PowerShell script execution results with the Group Policy Management Tool. We open the Group Policy Management Tool from the Server Manage icon to verify the results. By opening Group Policy Object, you can see Group 1, Group 2 and Group 3 are there. On the right panel click the Delegation tab. We see that User 1 and User 2 are added to Group 1 with Read privileges. In Group 2, we see User 3 and User 4 are added with permissions to edit settings. And finally we see User 5 and User 6 are added to Group 3 with all privileges, including edit settings, delete and modify security.
Page 4 of 5
Notices
Notices
? 2014 Carnegie Mellon University This material is distributed by the Software Engineering Institute (SEI) only to course attendees for their own individual study. Except for the U.S. government purposes described below, this material SHALL NOT be reproduced or used in any other manner without requesting formal permission from the Software Engineering Institute at permission@sei.cmu.edu. This material was created in the performance of Federal Government Contract Number FA8721-05-C-0003 with Carnegie Mellon University for the operation of the Software Engineering Institute, a federally funded research and development center. The U.S. government's rights to use, modify, reproduce, release, perform, display, or disclose this material are restricted by the Rights in Technical Data-Noncommercial Items clauses (DFAR 252-227.7013 and DFAR 252-227.7013 Alternate I) contained in the above identified contract. Any reproduction of this material or portions thereof marked with this legend must also reproduce the disclaimers contained on this slide. Although the rights granted by contract do not require course attendance to use this material for U.S. government purposes, the SEI recommends attendance to ensure proper understanding. THE MATERIAL IS PROVIDED ON AN "AS IS" BASIS, AND CARNEGIE MELLON DISCLAIMS ANY AND ALL WARRANTIES, IMPLIED OR OTHERWISE (INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE, RESULTS OBTAINED FROM USE OF THE MATERIAL, MERCHANTABILITY, AND/OR NON-INFRINGEMENT). CERT ? is a registered mark owned by Carnegie Mellon University.
2
Page 5 of 5
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- minecraft demo free no downloading
- minecraft free demo no download just play
- powershell using block
- powershell not using proxy
- using powershell to open csv
- powershell build path using variables
- powershell using variables
- using variables in powershell script
- install software using powershell script
- powershell using hash tables
- powershell using hashtable
- using powershell in sql server