SlideShare a Scribd company logo
Automating AD Administration in Windows PowerShell Don Jones Senior Partner & Principal Technologist Concentrated Technology, LLC
This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like. For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site,  www.ConcentratedTech.com .  For links to newly-posted decks, follow us on Twitter: @concentrateddon or @concentratdgreg This work is copyright ©Concentrated Technology, LLC
CAUTION: DEMOS AHEAD This is a demonstration-intensive session (very few slides) I will capture a shell transcript and save all of my scripts You can download these (in a week or so) from ConcentratedTech.com (there ’s a “Conference Materials” link in the menu)  • Don Jones • ConcentratedTech.com
Two Choices Microsoft ’s cmdlets Introduced in Win2008R2 Usable against 2003+ (w/Gateway add-on) Runs only on Win7/2008R2 No access to custom/RDS attributes or ADLDS Extensive pipeline input support Quest ’s cmdlets Third-party Usable against 2003+ Runs on XP+ Access to all attributes and ADLDS Lesser pipeline input support  • Don Jones • ConcentratedTech.com
Loading the Add-Ins Find Add-In Name Get-Module -list  Get-PSSnapin -reg Load Add-In Import-Module  name Add-PSSnapin  name Check new commands Gcm –module  name Gcm –pssnapin  name Ask for help Help  command-name  • Don Jones • ConcentratedTech.com
Pipeline Parameter Binding Use Import-CSV to import a CSV file Column headers become property names If property names match pipeline-bound parameter names, you can feed the CSV directly to the next cmdlet Demo – create new users with 2 commands on a single line! How to look for pipeline parameter binding in cmdlets ’ help  • Don Jones • ConcentratedTech.com
You Need This: DN Format Ou=Organizational unit Cn=Canonical Name Dc=Domain Cn=JohnD,ou=Sales,dc=microsoft,dc=com Ou=East,Ou=IT,dc=company,dc=pri  • Don Jones • ConcentratedTech.com
Filtering Criteria -eq (Equals) -like (* wildcard permitted) -ne (Not Equal) -gt / -lt (Greater/Less Than) -ge / -le (Greater/Less Than or Equal) -Filter is mandatory on MS cmdlets; used with major Get- cmdlets.  –Filter *  returns all. Filter Left!  • Don Jones • ConcentratedTech.com
Properties Subset of properties usually returned by default Pipe to GM to see all Use parameters to specify additional desired properties (differs between MS and Quest) – be aware of increased load to do so  • Don Jones • ConcentratedTech.com
Common Tasks Bulk-set an attribute for a bunch of users Get all computers based on password age Setting an account password Making a new OU Moving a user account to a different OU Remember: The cmdlet focus is on bulk and repetitive  common  tasks Quest cmdlets have greater coverage than MS cmdlets v1  • Don Jones • ConcentratedTech.com
Security + Drives The MS module maps an AD: drive You can map additional drives to other domains The credentials used to map the drive will be used by any cmdlets run while you are  “in” that drive Nice way to avoid having to constantly use the –credential parameter with the cmdlets! But the drive itself can be a bit tricky to use…  • Don Jones • ConcentratedTech.com
-PassThru Forces a cmdlet that sets or creates an object to also output that same object to the pipeline Enables longer command sequences  • Don Jones • ConcentratedTech.com
-WhatIf, -Confirm Implemented by most cmdlets that modify something (can) Prevent the module from doing whatever it normally does – also prevents it from outputting anything Typically can only be used with the last cmdlet on the command line (since it prevents output from being created)  • Don Jones • ConcentratedTech.com
Common Options (MS cmdlets) -SearchBase -SearchScope  • Don Jones • ConcentratedTech.com
GPO Let ’s also take a look at the GPO module in Win2008R2  • Don Jones • ConcentratedTech.com
Final Notes… Please be sure to submit a session evaluation form! Download slides & materials from  www.ConcentratedTech.com  within one week! Blog, URLs, and other information is also available at  www.ConcentratedTech.com  for your reference More resources on  www.ShellHub.com   Thank you very much!  • Don Jones • ConcentratedTech.com
This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like. For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site,  www.ConcentratedTech.com .  For links to newly-posted decks, follow us on Twitter: @concentrateddon or @concentratdgreg This work is copyright ©Concentrated Technology, LLC

More Related Content

Viewers also liked (19)

PPTX
Managing enterprise with PowerShell remoting
Concentrated Technology
 
KEY
PowerShell and the Future of Windows Automation
Concentrated Technology
 
PPTX
Implementing dr w. hyper v clustering
Concentrated Technology
 
PPTX
PowerShell and WMI
Concentrated Technology
 
PPT
Managing SQLserver
Concentrated Technology
 
PPTX
PowerShell crashcourse for sharepoint
Concentrated Technology
 
PPT
Automating Active Directory mgmt in PowerShell
Concentrated Technology
 
PPTX
Combining output from multiple sources
Concentrated Technology
 
PPTX
Ive got a powershell secret
Chris Conte
 
PPT
From VB Script to PowerShell
Concentrated Technology
 
PPTX
Introduction to powershell
Salaudeen Rajack
 
PDF
Advanced Tools & Scripting with PowerShell 3.0 Jump Start - Certificate
Don Reese
 
PPTX
PowerShell custom properties
Concentrated Technology
 
PPTX
Meet Windows PowerShell
Concentrated Technology
 
PPT
PS error handling and debugging
Concentrated Technology
 
PPT
PowerShell 8tips
Concentrated Technology
 
PPT
PowerShell v4 Desired State Configuration
Jason Stangroome
 
PPT
Ha & drs gotcha's
Concentrated Technology
 
PPTX
Basic PowerShell Toolmaking - Spiceworld 2016 session
Rob Dunn
 
Managing enterprise with PowerShell remoting
Concentrated Technology
 
PowerShell and the Future of Windows Automation
Concentrated Technology
 
Implementing dr w. hyper v clustering
Concentrated Technology
 
PowerShell and WMI
Concentrated Technology
 
Managing SQLserver
Concentrated Technology
 
PowerShell crashcourse for sharepoint
Concentrated Technology
 
Automating Active Directory mgmt in PowerShell
Concentrated Technology
 
Combining output from multiple sources
Concentrated Technology
 
Ive got a powershell secret
Chris Conte
 
From VB Script to PowerShell
Concentrated Technology
 
Introduction to powershell
Salaudeen Rajack
 
Advanced Tools & Scripting with PowerShell 3.0 Jump Start - Certificate
Don Reese
 
PowerShell custom properties
Concentrated Technology
 
Meet Windows PowerShell
Concentrated Technology
 
PS error handling and debugging
Concentrated Technology
 
PowerShell 8tips
Concentrated Technology
 
PowerShell v4 Desired State Configuration
Jason Stangroome
 
Ha & drs gotcha's
Concentrated Technology
 
Basic PowerShell Toolmaking - Spiceworld 2016 session
Rob Dunn
 

Similar to Automating ad with powershell (20)

PPT
PowerShell crashcourse
Concentrated Technology
 
PPTX
Microsoft Offical Course 20410C_04
gameaxt
 
PPTX
Automating AD Domain Services Administration
Napoleon NV
 
PPT
No-script PowerShell v2
Concentrated Technology
 
PPSX
Sunil phani's take on windows powershell
Sunil Phani
 
DOC
All dos commands
thetechnicalzone
 
PPTX
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...
Microsoft TechNet
 
PPTX
Inventory your network and clients with PowerShell
Concentrated Technology
 
DOC
To Get To The Command Prompt In Windows Xp Go To
drcha drche
 
PPTX
Microsoft Exchange Server 2019 Messagerie Electronique
amouwawa
 
PPTX
Power Shell for System Admins - By Kaustubh
Kaustubh Kumar
 
PPTX
Mark Minasi What’S New In Active Directory For Windows 7 Server 2008 R2
Nathan Winters
 
PDF
I Have the Power(View)
Will Schroeder
 
TXT
An a z index of windows power shell commandss
Ben Pope
 
PDF
Basic commands for powershell : Configuring Windows PowerShell and working wi...
Hitesh Mohapatra
 
PPTX
Windows 7 Feature Overview It Academic Day 2009
Tobias Koprowski
 
PDF
Power on, Powershell
Roo7break
 
PowerShell crashcourse
Concentrated Technology
 
Microsoft Offical Course 20410C_04
gameaxt
 
Automating AD Domain Services Administration
Napoleon NV
 
No-script PowerShell v2
Concentrated Technology
 
Sunil phani's take on windows powershell
Sunil Phani
 
All dos commands
thetechnicalzone
 
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...
Microsoft TechNet
 
Inventory your network and clients with PowerShell
Concentrated Technology
 
To Get To The Command Prompt In Windows Xp Go To
drcha drche
 
Microsoft Exchange Server 2019 Messagerie Electronique
amouwawa
 
Power Shell for System Admins - By Kaustubh
Kaustubh Kumar
 
Mark Minasi What’S New In Active Directory For Windows 7 Server 2008 R2
Nathan Winters
 
I Have the Power(View)
Will Schroeder
 
An a z index of windows power shell commandss
Ben Pope
 
Basic commands for powershell : Configuring Windows PowerShell and working wi...
Hitesh Mohapatra
 
Windows 7 Feature Overview It Academic Day 2009
Tobias Koprowski
 
Power on, Powershell
Roo7break
 
Ad

More from Concentrated Technology (16)

PPT
Wsus sample scripts
Concentrated Technology
 
PPTX
Wsus best practices
Concentrated Technology
 
PPT
Virtualization today
Concentrated Technology
 
PPTX
Virtualization auditing & security deck v1.0
Concentrated Technology
 
PPTX
Vdi in-a-box
Concentrated Technology
 
PPT
Top ESXi command line v2.0
Concentrated Technology
 
PPT
Supporting SQLserver
Concentrated Technology
 
PPT
Server Core2
Concentrated Technology
 
PPT
Securely connecting to apps over the internet using rds
Concentrated Technology
 
PPT
Rapidly deploying software
Concentrated Technology
 
PPT
PS scripting and modularization
Concentrated Technology
 
PPT
Prepping software for w7 deployment
Concentrated Technology
 
PPT
PowerShell Remoting
Concentrated Technology
 
PPTX
Managing SQLserver for the reluctant DBA
Concentrated Technology
 
PPT
Iis implementation
Concentrated Technology
 
PPT
Hyper v r2 deep dive
Concentrated Technology
 
Wsus sample scripts
Concentrated Technology
 
Wsus best practices
Concentrated Technology
 
Virtualization today
Concentrated Technology
 
Virtualization auditing & security deck v1.0
Concentrated Technology
 
Top ESXi command line v2.0
Concentrated Technology
 
Supporting SQLserver
Concentrated Technology
 
Securely connecting to apps over the internet using rds
Concentrated Technology
 
Rapidly deploying software
Concentrated Technology
 
PS scripting and modularization
Concentrated Technology
 
Prepping software for w7 deployment
Concentrated Technology
 
PowerShell Remoting
Concentrated Technology
 
Managing SQLserver for the reluctant DBA
Concentrated Technology
 
Iis implementation
Concentrated Technology
 
Hyper v r2 deep dive
Concentrated Technology
 
Ad

Recently uploaded (20)

PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
PPTX
Practical Applications of AI in Local Government
OnBoard
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
PDF
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
PDF
Why aren't you using FME Flow's CPU Time?
Safe Software
 
PDF
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
PPTX
The birth and death of Stars - earth and life science
rizellemarieastrolo
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Next level data operations using Power Automate magic
Andries den Haan
 
PDF
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
PDF
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
PDF
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
PDF
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
PDF
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PDF
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
PDF
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 
PDF
Understanding AI Optimization AIO, LLMO, and GEO
CoDigital
 
PDF
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
Practical Applications of AI in Local Government
OnBoard
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
Why aren't you using FME Flow's CPU Time?
Safe Software
 
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
The birth and death of Stars - earth and life science
rizellemarieastrolo
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Next level data operations using Power Automate magic
Andries den Haan
 
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 
Understanding AI Optimization AIO, LLMO, and GEO
CoDigital
 
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 

Automating ad with powershell

  • 1. Automating AD Administration in Windows PowerShell Don Jones Senior Partner & Principal Technologist Concentrated Technology, LLC
  • 2. This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like. For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site, www.ConcentratedTech.com . For links to newly-posted decks, follow us on Twitter: @concentrateddon or @concentratdgreg This work is copyright ©Concentrated Technology, LLC
  • 3. CAUTION: DEMOS AHEAD This is a demonstration-intensive session (very few slides) I will capture a shell transcript and save all of my scripts You can download these (in a week or so) from ConcentratedTech.com (there ’s a “Conference Materials” link in the menu) • Don Jones • ConcentratedTech.com
  • 4. Two Choices Microsoft ’s cmdlets Introduced in Win2008R2 Usable against 2003+ (w/Gateway add-on) Runs only on Win7/2008R2 No access to custom/RDS attributes or ADLDS Extensive pipeline input support Quest ’s cmdlets Third-party Usable against 2003+ Runs on XP+ Access to all attributes and ADLDS Lesser pipeline input support • Don Jones • ConcentratedTech.com
  • 5. Loading the Add-Ins Find Add-In Name Get-Module -list Get-PSSnapin -reg Load Add-In Import-Module name Add-PSSnapin name Check new commands Gcm –module name Gcm –pssnapin name Ask for help Help command-name • Don Jones • ConcentratedTech.com
  • 6. Pipeline Parameter Binding Use Import-CSV to import a CSV file Column headers become property names If property names match pipeline-bound parameter names, you can feed the CSV directly to the next cmdlet Demo – create new users with 2 commands on a single line! How to look for pipeline parameter binding in cmdlets ’ help • Don Jones • ConcentratedTech.com
  • 7. You Need This: DN Format Ou=Organizational unit Cn=Canonical Name Dc=Domain Cn=JohnD,ou=Sales,dc=microsoft,dc=com Ou=East,Ou=IT,dc=company,dc=pri • Don Jones • ConcentratedTech.com
  • 8. Filtering Criteria -eq (Equals) -like (* wildcard permitted) -ne (Not Equal) -gt / -lt (Greater/Less Than) -ge / -le (Greater/Less Than or Equal) -Filter is mandatory on MS cmdlets; used with major Get- cmdlets. –Filter * returns all. Filter Left! • Don Jones • ConcentratedTech.com
  • 9. Properties Subset of properties usually returned by default Pipe to GM to see all Use parameters to specify additional desired properties (differs between MS and Quest) – be aware of increased load to do so • Don Jones • ConcentratedTech.com
  • 10. Common Tasks Bulk-set an attribute for a bunch of users Get all computers based on password age Setting an account password Making a new OU Moving a user account to a different OU Remember: The cmdlet focus is on bulk and repetitive common tasks Quest cmdlets have greater coverage than MS cmdlets v1 • Don Jones • ConcentratedTech.com
  • 11. Security + Drives The MS module maps an AD: drive You can map additional drives to other domains The credentials used to map the drive will be used by any cmdlets run while you are “in” that drive Nice way to avoid having to constantly use the –credential parameter with the cmdlets! But the drive itself can be a bit tricky to use… • Don Jones • ConcentratedTech.com
  • 12. -PassThru Forces a cmdlet that sets or creates an object to also output that same object to the pipeline Enables longer command sequences • Don Jones • ConcentratedTech.com
  • 13. -WhatIf, -Confirm Implemented by most cmdlets that modify something (can) Prevent the module from doing whatever it normally does – also prevents it from outputting anything Typically can only be used with the last cmdlet on the command line (since it prevents output from being created) • Don Jones • ConcentratedTech.com
  • 14. Common Options (MS cmdlets) -SearchBase -SearchScope • Don Jones • ConcentratedTech.com
  • 15. GPO Let ’s also take a look at the GPO module in Win2008R2 • Don Jones • ConcentratedTech.com
  • 16. Final Notes… Please be sure to submit a session evaluation form! Download slides & materials from www.ConcentratedTech.com within one week! Blog, URLs, and other information is also available at www.ConcentratedTech.com for your reference More resources on www.ShellHub.com Thank you very much! • Don Jones • ConcentratedTech.com
  • 17. This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like. For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site, www.ConcentratedTech.com . For links to newly-posted decks, follow us on Twitter: @concentrateddon or @concentratdgreg This work is copyright ©Concentrated Technology, LLC

Editor's Notes

  • #2: MGB 2003 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.