Section 6: Using Windows PowerShell to Manage Group Policy Introducing Windows PowerShell Windows PowerShell Library for Group Policy Windows PowerShell-Based.

Slides:



Advertisements
Similar presentations
MCTS Guide to Microsoft Windows Server 2008 Network Infrastructure Configuration Chapter 6 Managing and Administering DNS in Windows Server 2008.
Advertisements

Lesson 17: Configuring Security Policies
$$ Idea Updatable help system Method overload discovery HelpUri attribute support HelpFile property on FunctionInfo Simplified Where and.
Chapter One The Essence of UNIX.
James Boother Blog: INTRODUCTION TO POWERSHELL.
Great people, great experience, great passion Administering SharePoint with Windows PowerShell Go Beyond the Management Shell with SharePoint and Windows.
10.1 © 2004 Pearson Education, Inc. Exam Planning, Implementing, and Maintaining a Microsoft Windows Server 2003 Active Directory Infrastructure.
V0.01 © 2009 Research In Motion Limited Introduction to Java Application Development for the BlackBerry Smartphone Trainer name Date.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 9: Implementing and Using Group Policy.
Hands-On Microsoft Windows Server 2003 Administration Chapter 5 Administering File Resources.
Terminal Server © N. Ganesan, Ph.D.. Reference Thin-Client Concept Thin-Client concept tutorial.
Check Disk. Disk Defragmenter Using Disk Defragmenter Effectively Run Disk Defragmenter when the computer will receive the least usage. Educate users.
Installing Windows XP Professional Using Attended Installation Slide 1 of 41Session 2 Ver. 1.0 CompTIA A+ Certification: A Comprehensive Approach for all.
Welcome Course 20410B Module 0: Introduction Audience
1 Chapter Overview Creating User and Computer Objects Maintaining User Accounts Creating User Profiles.
11 SYSTEMS ADMINISTRATION AND TERMINAL SERVICES Chapter 12.
Configuring Task Scheduler Lesson 9. Skills Matrix Technology SkillObjective Domain SkillDomain # Understanding Task Scheduler Configure and manage the.
Guide to MCSE , Enhanced 1 Activity 10-1: Restarting Windows Server 2003 Objective: to restart Windows Server 2003 Start  Shut Down  Restart Configure.
Microsoft ® Official Course Module 9 Configuring Applications.
1 Chapter Overview Monitoring Server Performance Monitoring Shared Resources Microsoft Windows 2000 Auditing.
Ch 11 Managing System Reliability and Availability 1.
Module 2 Creating Active Directory ® Domain Services User and Computer Objects.
9.1 © 2004 Pearson Education, Inc. Exam Planning, Implementing, and Maintaining a Microsoft Windows Server 2003 Active Directory Infrastructure.
Administering Windows 7 Lesson 11. Objectives Troubleshoot Windows 7 Use remote access technologies Troubleshoot installation and startup issues Understand.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 9: Implementing and Using Group Policy.
6.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 6: Administering User Accounts.
Guide to Linux Installation and Administration, 2e1 Chapter 8 Basic Administration Tasks.
CIM6400 CTNW (04/05) 1 CIM6400 CTNW Lesson 6 – More on Windows 2000.
Section 2: Using Group Policy Management Tools Local vs. Domain Policies Editing Local Policies Managing Domain Policies Understanding Group Policy Refresh.
Microsoft ® Official Course Module XA Using Windows PowerShell ®
Section 8: Configuring the Desktop Environment with Group Policy Exploring Script Types and Controlling Script Execution Defining the Desktop, Start Menu,
Appendix A Starting Out with Windows PowerShell™ 2.0.
Section 1: Introducing Group Policy What Is Group Policy? Group Policy Scenarios New Group Policy Features Introduced with Windows Server 2008 and Windows.
Module 7: Fundamentals of Administering Windows Server 2008.
Shell Scripting Introduction. Agenda What is Shell Scripting? Why use Shell Scripting? Writing and Running a Shell Script Basic Commands -ECHO - REM.
Section 12: Creating and Deploying Administrative Templates Introducing Administrative Templates Legacy ADM Templates Using the New ADMX Templates Converting.
1 Chapter Overview Configuring Account Policies Configuring User Rights Configuring Security Options Configuring Internet Options.
Good Morning and Thank You!.  Have some Fun!  Learn at least one thing new!  Make myself available to you So please …  Ask questions and enjoy!
Planning a Group Policy Management and Implementation Strategy Lesson 10.
Section 13: Configuring Group Policy Preferences Introducing Group Policy Preferences Comparing Preferences and Policy Settings Configuring Preferences.
Module 1: Configuring Windows Server Module Overview Describe Windows Server 2008 roles Describe Windows Server 2008 features Describe Windows Server.
Section 9: Configuring Roaming Profiles and Folder Redirection Managing User Profiles Configuring Folder Redirection Using Folder Redirection and Roaming.
Section 5: Troubleshooting and Backing Up GPOs Using Group Policy Troubleshooting Tools Integration of RSoP Functionality Using Logging Options Backing.
MCTS Guide to Microsoft Windows Server 2008 Applications Infrastructure Configuration (Exam # ) Chapter Five Windows Server 2008 Remote Desktop Services,
1 © 2003, Cisco Systems, Inc. All rights reserved. CCNA 2 Module 2 Introduction to Routers.
Section 11: Implementing Software Restriction Policies and AppLocker What Is a Software Restriction Policy? Creating a Software Restriction Policy Using.
Troubleshooting Security Issues Lesson 6. Skills Matrix Technology SkillObjective Domain SkillDomain # Monitoring and Troubleshooting with Event Viewer.
Section 4: Understanding the Architecture of Group Policy Processing Group Policy Components in AD DS Understanding the Group Policy Processing Sequence.
Corey Hynes HynesITe, Inc Session Code: SRV317 Objectives Let you walk out of here, being able to run a script against an OU of computers, to make some.
Windows PowerShell Introduction 1 Morgan Simonsen Ementor.
Understanding and Using the Registry Chapter Twenty Two.
 An alias is an alternative name assigned to a Cmdlet.  Aliases allow users to quickly interact with the shell.  The Cmdlet get-alias is.
MySQL Getting Started BCIS 3680 Enterprise Programming.
Administering Microsoft Windows Server 2003 Chapter 2.
Week 4 Objectives Overview of Group Policy Group Policy Processing Implementing a Central Store for Administrative Templates.
Implementing a Group Policy Infrastructure
1 Active Directory Administration Tasks And Tools Active Directory Administration Tasks Active Directory Administrative Tools Using Microsoft Management.
 It is Microsoft's new task-based command- line shell and scripting language designed especially for system administration.  It helps Information Technology.
Windows PowerShell. What is Windows PowerShell? A command-line interface (CLI) A new way of developing Windows and other products to be more manageable.
Module 14: Advanced Topics and Troubleshooting. Microsoft ® Windows ® Small Business Server (SBS) 2008 Management Console (Advanced Mode) Managing Windows.
 Version 1.0[edit]edit  Version 1.0 was released in 2006 for Windows XP SP2/SP3, Windows Server 2003,
V7 Foundation Series Vignette Education Services.
Windows Certification Paths OR MCSA Windows Server 2012 Installing and Configuring Windows Server 2012 Exam (20410) Administering Windows Server.
Windows Vista Configuration MCTS : Internet Explorer 7.0.
19 Copyright © 2008, Oracle. All rights reserved. Security.
Office PowerShell administration
PowerShell 2.0 Remoting Ravikanth C.
Microsoft Ignite NZ October 2016 SKYCITY, Auckland.
PowerShell Best Practices for SQL DBA’s
Planning a Group Policy Management and Implementation Strategy
Presentation transcript:

Section 6: Using Windows PowerShell to Manage Group Policy Introducing Windows PowerShell Windows PowerShell Library for Group Policy Windows PowerShell-Based Logon Scripts Managing Windows Environments with Group Policy

© 2013 Global Knowledge Training LLC. All rights reserved. Section Objectives After completing this section, you will be able to: Describe the Windows PowerShell features Explain how to perform the basic Windows PowerShell operations Explain how to access the Windows PowerShell library for Group Policy List the third-party Windows PowerShell-based logon script tools 6-2

© 2013 Global Knowledge Training LLC. All rights reserved. Introducing Windows PowerShell 6-3 Windows PowerShell Features Windows PowerShell Scenarios Using Windows PowerShell

© 2013 Global Knowledge Training LLC. All rights reserved. Windows PowerShell Features Thousands of cmdlets Scripting language to accelerate automation Support for existing scripts and tools Standard naming conventions for commands Access to ADSI, WMI, COM, ADO, HTML, and XML data Command-line navigation of the file system, registry, certificate store, and more Robust logging and error-handling Access to object and system administration data Extensible interface for third-party development 6-4

© 2013 Global Knowledge Training LLC. All rights reserved. Windows PowerShell Scenarios Managing services, processes, registry, and WMI data Terminal Server management Managing IIS 7.0 Managing Group Policy Logon Scripts And much more! PS C:\> 6-5

© 2013 Global Knowledge Training LLC. All rights reserved. Using Windows PowerShell Opening Windows PowerShell Chaining commands Writing Scripts Running Scripts Core Cmdlets PS C:\> 6-6

© 2013 Global Knowledge Training LLC. All rights reserved. Opening Windows PowerShell Open Windows PowerShell in many different ways: Run it from the Start, All Programs, Windows PowerShell, Windows PowerShell shortcut. Type powershell at a command prompt. Use the PowerShell taskbar shortcut. Go to the Start screen and type PowerShell. PS C:\> 6-6

© 2013 Global Knowledge Training LLC. All rights reserved. Chaining Commands You can chain several commands together on the same line such as with the following command: get-command | convertto-html -property name,definition -title "Cmdlets" > cmdlets.htm ; invoke-item cmdlets.htm PS C:\> 6-7 The pipe symbol sends the output of one cmdlet to another. The semicolon symbol signifies the beginning of a new command.

© 2013 Global Knowledge Training LLC. All rights reserved. Writing Scripts PowerShell scripts can be saved with a *.ps1 extension or can be written directly at the PowerShell prompt. $a = get-service | select-object name, status foreach ($i in $a) { if ($i.status -eq "running") {write-host $i.name -foregroundcolor "green"} elseif ($i.status -eq "stopped") {write-host $i.name -foregroundcolor "white"} else {write-host $i.name} } 6-8 After typing multiple lines of code at the prompt, press Enter twice to execute the code block.

© 2013 Global Knowledge Training LLC. All rights reserved. Running Scripts By default, PowerShell does not allow scripts to be run for security reasons. The Execution Policy must be relaxed to allow scripts to run. Use Set-ExecutionPolicy to set one of the following levels: Restricted AllSigned RemoteSigned Unrestricted Bypass 6-9

© 2013 Global Knowledge Training LLC. All rights reserved. Core Cmdlets (1) Add-PSSnapin Adds one or more Windows PowerShell snap-ins to the current session. Clear-HistoryDeletes entries from the command history. Clear-HostDeletes entries from the command history. Connect-PSSessionReconnects to disconnected sessions. Disable-PSRemoting Prevents the computer from receiving remote Windows PowerShell commands. Disable- PSSessionConfiguration Denies access to the session configurations on the local computer. Disconnect-PSSessionDisconnects from a session. Enable-PSRemotingConfigures the computer to receive remote commands. Enable- PSSessionConfiguration Configures the computer to receive remote commands. Enter-PSSessionStarts an interactive session with a remote computer. Exit-PSSessionEnds an interactive session with a remote computer. Add-PSSnapin Adds one or more Windows PowerShell snap-ins to the current session. 6-9

© 2013 Global Knowledge Training LLC. All rights reserved. Core Cmdlets (2) Export-Console Exports the names of snap-ins in the current session to a console file. Export-ModuleMemberSpecifies the module members that are exported. ForEach-ObjectPerforms an operation against each of a set of input objects. Get-CommandGets all commands. Get-Help Displays information about Windows PowerShell cmdlets and concepts. Get-HistoryGets a list of the commands entered during the current session. Get-Job Gets Windows PowerShell background jobs (PsJobs) that are running in the current console. Get-Module Gets the modules that have been imported, or can be imported, into the current session. Get-PSSession Gets the Windows PowerShell sessions (PSSessions) in the current session. Get-PSSessionConfigurationGets the session configurations registered on the computer. Get-PSSnapinGets the Windows PowerShell snap-ins on the computer. Get-VerbGets approved Windows PowerShell verbs. 6-10

© 2013 Global Knowledge Training LLC. All rights reserved. Core Cmdlets (3) Import-ModuleAdds modules to the current session. Invoke-CommandRuns commands on local and remote computers. Invoke-HistoryRuns commands from the session history. New-ModuleCreates a new dynamic module that exists only in memory. New-ModuleManifestCreates a new module manifest. New-PSSessionCreates a persistent connection to a local or remote computer. New- PSSessionConfigurationFile Creates a file that defines a session configuration. New-PSSessionOptionCreates an object that contains advanced options for a session. New-PSTransportOption Creates an object that contains advanced options for a session configuration. Out-Default Sends the output to the default formatter and the default output cmdlet. It is a placeholder that lets you write your own Out-Default function or cmdlet. Out-HostSends output to the console. Out-NullDeletes output instead of sending it to the console. 6-10

© 2013 Global Knowledge Training LLC. All rights reserved. Core Cmdlets (4) Receive-Job Gets the results of the Windows PowerShell background jobs in the current session. Register- PSSessionConfiguration Creates and registers a new session configuration. Remove-JobDeletes a Windows PowerShell background job. Remove-ModuleRemoves modules from the current session. Remove-PSSessionCloses one or more Windows PowerShell sessions (PSSessions). Remove-PSSnapinRemoves Windows PowerShell snap-ins from the current session. Resume-JobRestarts a suspended job. Save-HelpDownloads and saves the newest help files to a file system directory. Set-PSDebug Turns script debugging features on and off, sets the trace level and toggles strict mode. Set-PSSessionConfigurationChanges the properties of a registered session configuration. Set-StrictMode Establishes and enforces coding rules in expressions, scripts, and script blocks. Start-JobStarts a Windows PowerShell background job. 6-11

© 2013 Global Knowledge Training LLC. All rights reserved. Core Cmdlets (5) Receive-Job Gets the results of the Windows PowerShell background jobs in the current session. Register-PSSessionConfiguration Creates and registers a new session configuration. Remove-Job Deletes a Windows PowerShell background job. Remove-Module Removes modules from the current session. Remove-PSSession Closes one or more Windows PowerShell sessions (PSSessions). Remove-PSSnapin Removes Windows PowerShell snap-ins from the current session. Resume-Job Restarts a suspended job. Save-Help Downloads and saves the newest help files to a file system directory. 6-11/12 Stop-JobStops a Windows PowerShell background job. Suspend-JobTemporarily stops workflow jobs. Test-ModuleManifest Verifies that a module manifest accurately describes the contents of a module. Test- PSSessionConfigurationFile Verifies the keys and values in a session configuration file. Unregister- PSSessionConfiguration Deletes a registered session configurations from the computer. Update-HelpDownloads and installs the newest help files on your computer. Wait-Job Suppresses the command prompt until one or all of the Windows PowerShell background jobs are complete. Where-Object Creates a filter that controls which objects will be passed along a command pipeline.

© 2013 Global Knowledge Training LLC. All rights reserved. Windows PowerShell Library for Group Policy A Windows PowerShell library for Group Policy is now available. import-module grouppolicy get-command -module grouppolicy 6-13

© 2013 Global Knowledge Training LLC. All rights reserved. Windows PowerShell Cmdlets for Group Policy 6-13 Invoke-GPUpdateGet-GPPermissionsRemove-GPRegistryValue Get-GPResultantSetOfPolicySet-GPPermissionsRename-GPO Backup-GPOImport-GPORestore-GPO New-GPOCopy-GPOSet-GPInheritance New-GPLinkGet-GPPermissionSet-GPLink Get-GPOGet-GPInheritanceSet-GPPermission Get-GPOReportNew-GPStarterGPOSet-GPPrefRegistryValue Get-GPStarterGPORemove-GPLinkSet-GPRegistryValue Get-GPPrefRegistryValueRemove-GPO Get-GPRegistryValue Remove- GPPrefRegistryValue Below are the CmdLets specific to Group Policy:

© 2013 Global Knowledge Training LLC. All rights reserved. Windows PowerShell-Based Logon Scripts Windows 7 and later allow for Windows PowerShell- based logon scripts. Windows PowerShell is enabled by default in Windows 7 and Windows Server 2008 R2. Windows PowerShell Logon Scripts allow for more powerful logon scripts. Use PowerShell ISE to create and edit scripts Other third-party editing tools include: Specops Command ( Admin Script Editor (ASE) ( PowerGUI ( 6-14

© 2013 Global Knowledge Training LLC. All rights reserved. Summary Some of the Windows PowerShell features are: Cmdlets for performing administrative tasks Scripting language that accelerates automation of repetitive tasks due to its integration with the command-line shell Support for existing scripts, existing command-line tools, and multiple operating systems Commands that follow standard naming conventions and work with a small set of intuitive utilities 6-16

© 2013 Global Knowledge Training LLC. All rights reserved. Summary (cont.) Simple access to objects and system administration data, and the ability to pipe objects between command- line tools Extensible interface that allows third-party vendors to quickly build custom tools and utilities to administer applications running Windows Server

© 2013 Global Knowledge Training LLC. All rights reserved. Summary (cont.) You should know how to perform some of the following basic Windows PowerShell tasks: Open Windows PowerShell: Three different methods: 1) Click Start, All Programs, Windows PowerShell, and Windows PowerShell shortcut. 2) Type powershell at the command prompt. 3) Click Start, select Run, and type powershell. Chain commands: Chain several commands together on the same line. Write scripts: Compose scripts at the command-line within the Windows PowerShell. Run scripts: Type the full path to the file, or, if the current directory is where the scripts are located, type.\ before the file name. 6-16

© 2013 Global Knowledge Training LLC. All rights reserved. Summary (cont.) To access the Windows PowerShell library for Group Policy, first load the Group Policy module (open Windows PowerShell and type import-module grouppolicy). To display the list of Group Policy commands, open Windows PowerShell and type get- command -module grouppolicy. Some of the third-party Windows PowerShell-based logon script tools are: Specops command Admin Scipt Editor PowerGUI 6-16

© 2013 Global Knowledge Training LLC. All rights reserved. Knowledge Check 1.What must you do in Windows PowerShell before you can display the list of Group Policy commands? Load the Group Policy module 6-17

© 2013 Global Knowledge Training LLC. All rights reserved. Knowledge Check (cont.) 2.Which of the following is a feature of Windows PowerShell? a.Simple access to objects and system administration data, and provides the ability to pipe objects between command-line tools b.Cmdlets for performing administrative tasks c.Run PowerShell commands against Windows 2000 operating systems d.Logging and error-handling capabilities for script execution tracking and error handling 6-17

© 2013 Global Knowledge Training LLC. All rights reserved. Knowledge Check (cont.) 3.Which extension is used to save a Windows PowerShell script file?.ps1 4.List some of the third-party Windows PowerShell- based logon script tools. Specops command Admin Scipt Editor PowerGUI 6-17