SlideShare a Scribd company logo
Automating Active Directory Management in Windows PowerShell Don Jones ConcentratedTech.com Pre-requisites for this presentation:  1) Familiarity with AD administration 2) Basic understanding of how to use Windows PowerShell Level:  Intermediate
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
About the Instructor Don Jones Contributing Editor,  technetmagazine.com IT author, consultant, and speaker Co-founder of Concentrated Technology Seven-time recipient of Microsoft ’s Most Valuable Professional (MVP) Award Author and Editor-in-Chief for Realtime Publishers Trainer for www.CBTNuggets.com
About this Session Primarily demo  – not slides   We ’ll start with some key functional concepts, and move right into the “how-to” Bring your questions  –  anytime  is the time to ask them! Don ’t save ‘em for the end. We ’ll take a quick break halfway through
Start Thinking Since we ’re mostly doing demos, start thinking of AD administrative tasks you’d like to automate I ’ll take your suggestions and construct some demos on the fly
Cool… I ’ll capture everything I type in the shell into a text file, and save all of my scripts There ’s no need for you to copy down anything I do It ’ll all be available for download from my Web site after the show URL is on the last slide, and there are  “reminder” cards if you’d like to take one Now let ’s go…
Requirements Windows PowerShell v2 Windows 7 or Windows Server 2008 R2 PowerShell v2 is available back to WinXP You need a Win7 or Win2008R2 machine to run the commands I ’ll be showing – at least one such machine in your environment Compatible Domain Controller Windows Server 2008 R2 Windows Server 2008 (w/Gateway Service) Windows Server 2003 (w/Gateway Service)
Gateway Service The PowerShell AD commands  “talk” to a Gateway Service Ships with Win2008R2 Available for Win2008/Win2003  – you do not  need  a 2008 R2 domain controller http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=008940c6-0296-4597-be3e-1d24c1cf0dda
Managing from Vista/XP? No problem  – get PowerShell v2 installed and I ’ll show you how you can use these older versions to run the AD commands This ’ll come at the end PowerShell v2:  http://support.microsoft.com/kb/968929 Win2003, Win2008, WinXP, Win2003, Vista Preinstalled w/Win2008R2 and Win7
First: The AD Module This module is installed with AD in Win2008R2, and with the RSAT on Win7 Import-Module ActiveDirectory Adds a PSDrive provider an several dozen new cmdlets Using it a lot? Put the Import-Module command into your PowerShell profile script
Second: The AD: Drive A drive (AD:) is automatically mapped to your logon domain You can map additional drives to other domains Change to the AD: drive and run  New-PSDrive  to do so You can specify alternate credentials for the drive mapping
What ’s the Drive For? The drive is useful for managing ACLs using Get-ACL and Set-ACL It ’s primary purpose, however, is to “remember” the credentials you used to map the drive in the first place Whenever you are  “in” an AD drive, any AD cmdlets you run will automatically use the drive’s credentials Saves you from having to specify a  –credential parameter for every command!
Third: The AD Cmdlets Let ’s see the cmdlets added by this module They come with full help, including detailed usage examples RTFM  – The help is your friend!!! Let ’s play with a few of these cmdlets to get a feel for how they work Remember, you can always specify  –credential, but if you ’re “in” an AD drive, it’ll use those credentials automatically
Pipeline Input Most AD cmdlets accept pipeline input, meaning you don ’t have to specify parameters – you can pipe data in Each parameter can attach to pipeline input  “ByValue” or “ByPropertyName” Let ’s look at the differences with a very cool example
ByPropertyName This requires input objects ’ property names to  match  the parameter names What if they don ’t? Use  Select-Object  to copy an existing property to a new one having a matching name Let ’s see another tres cool example
Gotchas New-ADUser ’s docs don’t say that –Name is required – it is -samAccountName is not required – but it is. Let ’s see why.
Gotchas By default, most Get-AD* cmdlets only pull over a subset of attributes Use the –property parameter (e.g., -prop *) to pull over more This raises the load on the responding domain controller – use with some caution Let ’s see
Best Practice Always use –filter to minimize what ’s brought back by a Get-AD* cmdlet (that’s why –filter is a required parameter) Don ’t rely on –filter * in a production environment -filter uses standard PowerShell comparison operators Let ’s see
Tip If you don ’t know LDAP naming conventions, this is a good time to learn CN = Canonical Name (user, group, container) OU = organizational unit DC = DNS domain name component Cn=DonJ,ou=Sales,ou=West,dc=company,dc=com Work from the more specific to the least specific (object to top-level domain)
Pipeline Output Many AD cmdlets don ’t normally produce output -passThru forces them to output whatever object they created or whatever object was input This enables powerful command chains – one liners that accomplish the work of a complicated script Let ’s see!
Passwords Cmdlets which accept a password require it as a SecureString Use  ConvertTo-SecureString   string  –force to create a secure string Let ’s see…
Demos, Demos, Demos Let ’s take some of your suggestions for demos We ’ll also make sure we run through at least one quick demo for each major category of cmdlets We ’ve got the time – so you’ll get to see how everything works Remember, this is all going into a transcript and I ’m saving my script files – download URL at the end!
Using an Older OS? Provided you have: A domain controller running the Gateway Service At least one Win7 or Win2008R2 machine You can use the AD commands on XP, Vista, 2003, and 2008 RTM Using a feature called  implicit remoting Establish a PSSession remoting connection to the Win7 or Win2008R2 machine “ Import” the AD commands  from the remote machine
Implicit Remoting
Step 1 Establish a session to a remote machine that has the cmdlets Tell the remote session to import the AD module
Step 2 Export the AD commands to an Implicit Remoting Module – this is a module that lives on your local disk PowerShell will create this in your Documents folder under WindowsPowerShell/Modules
Step 3 To use the remote commands, make sure the remote machine is running Import the module that ’s on your local computer Notice that you specify a prefix for the remote commands New-ADUser is now New-RemADUser Helps distinguish remote commands
Help? You can ’t get help on remote commands until the remote session is running Get the remote session running by trying to run a remote command Break out of the command if you don ’t really want to run it
Running Commands What ’s on your local computer is a “pointer” to the real cmdlet running on the remote machine The cmdlet execution takes place remotely; you see the results on your computer Great way to run commands that don ’t, or can’t, exist on your local machine – but which do exist on another machine on the network Great reason to get  one  Win2008R2 DC in the environment
Finished? The remote session will close as soon as your local PowerShell session closes This all requires that PowerShell remoting be set up in advance – that ’s a whole separate session!
Q&A Last chance for Q&A Also a last chance for some additional demos
Thank You! Please feel free to pick up a card if you ’d like copies of my session materials I ’ll be happy to take any last questions while I pack up Please complete and submit an evaluation form for this and every session you attend!
 
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
Ad

More Related Content

What's hot (20)

Virtualization auditing & security deck v1.0
Virtualization auditing & security deck v1.0Virtualization auditing & security deck v1.0
Virtualization auditing & security deck v1.0
Concentrated Technology
 
Vdi in-a-box
Vdi in-a-boxVdi in-a-box
Vdi in-a-box
Concentrated Technology
 
Wsus sample scripts
Wsus sample scriptsWsus sample scripts
Wsus sample scripts
Concentrated Technology
 
No-script PowerShell v2
No-script PowerShell v2No-script PowerShell v2
No-script PowerShell v2
Concentrated Technology
 
PowerShell custom properties
PowerShell custom propertiesPowerShell custom properties
PowerShell custom properties
Concentrated Technology
 
Virtualization today
Virtualization todayVirtualization today
Virtualization today
Concentrated Technology
 
lab manual (pata ni)
lab manual (pata ni)lab manual (pata ni)
lab manual (pata ni)
shubham509
 
Implementing CI CD UiPath Using Jenkins Plugin
Implementing CI CD UiPath Using Jenkins PluginImplementing CI CD UiPath Using Jenkins Plugin
Implementing CI CD UiPath Using Jenkins Plugin
Satish Prasad
 
Deploying w7
Deploying w7Deploying w7
Deploying w7
Concentrated Technology
 
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages HeavenIBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
Paul Withers
 
PowerShell-2
PowerShell-2PowerShell-2
PowerShell-2
Saravanan G
 
Rock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment WorkflowsRock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment Workflows
AOE
 
Akmal Khaleeq Waheed - Challenge 3
Akmal Khaleeq Waheed - Challenge 3Akmal Khaleeq Waheed - Challenge 3
Akmal Khaleeq Waheed - Challenge 3
tovmug
 
Kautilya: Teensy beyond shell
Kautilya: Teensy beyond shellKautilya: Teensy beyond shell
Kautilya: Teensy beyond shell
Nikhil Mittal
 
Jenkins review buddy
Jenkins review buddyJenkins review buddy
Jenkins review buddy
Aske Olsson
 
PowerShell 2.0 remoting
PowerShell 2.0 remotingPowerShell 2.0 remoting
PowerShell 2.0 remoting
Ravikanth Chaganti
 
Remote Control WordPress
Remote Control WordPressRemote Control WordPress
Remote Control WordPress
Edmund Turbin
 
RACE - Minimal Rights and ACE for Active Directory Dominance
RACE - Minimal Rights and ACE for Active Directory DominanceRACE - Minimal Rights and ACE for Active Directory Dominance
RACE - Minimal Rights and ACE for Active Directory Dominance
Nikhil Mittal
 
Automating Post Exploitation with PowerShell
Automating Post Exploitation with PowerShellAutomating Post Exploitation with PowerShell
Automating Post Exploitation with PowerShell
EnclaveSecurity
 
Cloud computing - an architect's perspective
Cloud computing - an architect's perspectiveCloud computing - an architect's perspective
Cloud computing - an architect's perspective
HARMAN Services
 
Virtualization auditing & security deck v1.0
Virtualization auditing & security deck v1.0Virtualization auditing & security deck v1.0
Virtualization auditing & security deck v1.0
Concentrated Technology
 
lab manual (pata ni)
lab manual (pata ni)lab manual (pata ni)
lab manual (pata ni)
shubham509
 
Implementing CI CD UiPath Using Jenkins Plugin
Implementing CI CD UiPath Using Jenkins PluginImplementing CI CD UiPath Using Jenkins Plugin
Implementing CI CD UiPath Using Jenkins Plugin
Satish Prasad
 
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages HeavenIBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
Paul Withers
 
Rock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment WorkflowsRock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment Workflows
AOE
 
Akmal Khaleeq Waheed - Challenge 3
Akmal Khaleeq Waheed - Challenge 3Akmal Khaleeq Waheed - Challenge 3
Akmal Khaleeq Waheed - Challenge 3
tovmug
 
Kautilya: Teensy beyond shell
Kautilya: Teensy beyond shellKautilya: Teensy beyond shell
Kautilya: Teensy beyond shell
Nikhil Mittal
 
Jenkins review buddy
Jenkins review buddyJenkins review buddy
Jenkins review buddy
Aske Olsson
 
Remote Control WordPress
Remote Control WordPressRemote Control WordPress
Remote Control WordPress
Edmund Turbin
 
RACE - Minimal Rights and ACE for Active Directory Dominance
RACE - Minimal Rights and ACE for Active Directory DominanceRACE - Minimal Rights and ACE for Active Directory Dominance
RACE - Minimal Rights and ACE for Active Directory Dominance
Nikhil Mittal
 
Automating Post Exploitation with PowerShell
Automating Post Exploitation with PowerShellAutomating Post Exploitation with PowerShell
Automating Post Exploitation with PowerShell
EnclaveSecurity
 
Cloud computing - an architect's perspective
Cloud computing - an architect's perspectiveCloud computing - an architect's perspective
Cloud computing - an architect's perspective
HARMAN Services
 

Viewers also liked (17)

Ive got a powershell secret
Ive got a powershell secretIve got a powershell secret
Ive got a powershell secret
Chris Conte
 
Combining output from multiple sources
Combining output from multiple sourcesCombining output from multiple sources
Combining output from multiple sources
Concentrated Technology
 
PowerShell and the Future of Windows Automation
PowerShell and the Future of Windows AutomationPowerShell and the Future of Windows Automation
PowerShell and the Future of Windows Automation
Concentrated Technology
 
Managing enterprise with PowerShell remoting
Managing enterprise with PowerShell remotingManaging enterprise with PowerShell remoting
Managing enterprise with PowerShell remoting
Concentrated Technology
 
Introduction to powershell
Introduction to powershellIntroduction to powershell
Introduction to powershell
Salaudeen Rajack
 
Best free tools for win database admin
Best free tools for win database adminBest free tools for win database admin
Best free tools for win database admin
Concentrated Technology
 
PowerShell crash course
PowerShell crash coursePowerShell crash course
PowerShell crash course
Concentrated Technology
 
Best free tools for w d a
Best free tools for w d aBest free tools for w d a
Best free tools for w d a
Concentrated Technology
 
Ha & drs gotcha's
Ha & drs gotcha'sHa & drs gotcha's
Ha & drs gotcha's
Concentrated Technology
 
Managing SQLserver
Managing SQLserverManaging SQLserver
Managing SQLserver
Concentrated Technology
 
Advanced Tools & Scripting with PowerShell 3.0 Jump Start - Certificate
Advanced Tools & Scripting with PowerShell 3.0 Jump Start - CertificateAdvanced Tools & Scripting with PowerShell 3.0 Jump Start - Certificate
Advanced Tools & Scripting with PowerShell 3.0 Jump Start - Certificate
Don Reese
 
PowerShell v4 Desired State Configuration
PowerShell v4 Desired State ConfigurationPowerShell v4 Desired State Configuration
PowerShell v4 Desired State Configuration
Jason Stangroome
 
Automating ad with powershell
Automating ad with powershellAutomating ad with powershell
Automating ad with powershell
Concentrated Technology
 
Free tools for win server administration
Free tools for win server administrationFree tools for win server administration
Free tools for win server administration
Concentrated Technology
 
Ad disasters & how to prevent them
Ad disasters & how to prevent themAd disasters & how to prevent them
Ad disasters & how to prevent them
Concentrated Technology
 
PowerShell Functions
PowerShell FunctionsPowerShell Functions
PowerShell Functions
mikepfeiffer
 
Basic PowerShell Toolmaking - Spiceworld 2016 session
Basic PowerShell Toolmaking - Spiceworld 2016 sessionBasic PowerShell Toolmaking - Spiceworld 2016 session
Basic PowerShell Toolmaking - Spiceworld 2016 session
Rob Dunn
 
Ive got a powershell secret
Ive got a powershell secretIve got a powershell secret
Ive got a powershell secret
Chris Conte
 
PowerShell and the Future of Windows Automation
PowerShell and the Future of Windows AutomationPowerShell and the Future of Windows Automation
PowerShell and the Future of Windows Automation
Concentrated Technology
 
Managing enterprise with PowerShell remoting
Managing enterprise with PowerShell remotingManaging enterprise with PowerShell remoting
Managing enterprise with PowerShell remoting
Concentrated Technology
 
Introduction to powershell
Introduction to powershellIntroduction to powershell
Introduction to powershell
Salaudeen Rajack
 
Advanced Tools & Scripting with PowerShell 3.0 Jump Start - Certificate
Advanced Tools & Scripting with PowerShell 3.0 Jump Start - CertificateAdvanced Tools & Scripting with PowerShell 3.0 Jump Start - Certificate
Advanced Tools & Scripting with PowerShell 3.0 Jump Start - Certificate
Don Reese
 
PowerShell v4 Desired State Configuration
PowerShell v4 Desired State ConfigurationPowerShell v4 Desired State Configuration
PowerShell v4 Desired State Configuration
Jason Stangroome
 
Free tools for win server administration
Free tools for win server administrationFree tools for win server administration
Free tools for win server administration
Concentrated Technology
 
PowerShell Functions
PowerShell FunctionsPowerShell Functions
PowerShell Functions
mikepfeiffer
 
Basic PowerShell Toolmaking - Spiceworld 2016 session
Basic PowerShell Toolmaking - Spiceworld 2016 sessionBasic PowerShell Toolmaking - Spiceworld 2016 session
Basic PowerShell Toolmaking - Spiceworld 2016 session
Rob Dunn
 
Ad

Similar to Automating Active Directory mgmt in PowerShell (20)

Inventory your network and clients with PowerShell
Inventory your network and clients with PowerShellInventory your network and clients with PowerShell
Inventory your network and clients with PowerShell
Concentrated Technology
 
Windows PowerShell
Windows PowerShellWindows PowerShell
Windows PowerShell
Orbit One - We create coherence
 
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...
Microsoft TechNet
 
PowerShell-1
PowerShell-1PowerShell-1
PowerShell-1
Saravanan G
 
Windows Server 2008 Management
Windows Server 2008 ManagementWindows Server 2008 Management
Windows Server 2008 Management
Hi-Techpoint
 
Windows Server 2008 Management
Windows Server 2008 ManagementWindows Server 2008 Management
Windows Server 2008 Management
Hi-Techpoint
 
Windows PowerShell Remoting Presentation.pdf
Windows PowerShell Remoting Presentation.pdfWindows PowerShell Remoting Presentation.pdf
Windows PowerShell Remoting Presentation.pdf
Syahri Ramadhan
 
Intro to PowerShell
Intro to PowerShellIntro to PowerShell
Intro to PowerShell
Adam Preston
 
Power Shell for System Admins - By Kaustubh
Power Shell for System Admins - By KaustubhPower Shell for System Admins - By Kaustubh
Power Shell for System Admins - By Kaustubh
Kaustubh Kumar
 
Powershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge ClubPowershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge Club
Essam Salah
 
Windows PowerShell.pptx
Windows PowerShell.pptxWindows PowerShell.pptx
Windows PowerShell.pptx
MuhammadYasirKhan42
 
Power shell training
Power shell trainingPower shell training
Power shell training
David Brabant
 
PowerShell for SharePoint Developers
PowerShell for SharePoint DevelopersPowerShell for SharePoint Developers
PowerShell for SharePoint Developers
Boulos Dib
 
Using SCCM 2012 r2 to Patch Linux, UNIX and Macs
Using SCCM 2012 r2 to Patch Linux, UNIX and MacsUsing SCCM 2012 r2 to Patch Linux, UNIX and Macs
Using SCCM 2012 r2 to Patch Linux, UNIX and Macs
Lumension
 
Practical management of development & QA environments for SharePoint 2013
Practical management of development & QA environments for SharePoint 2013Practical management of development & QA environments for SharePoint 2013
Practical management of development & QA environments for SharePoint 2013
SharePointRadi
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
SharePoint Saturday NY
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
SharePoint Saturday NY
 
Admin SharePoint 2010 with PowerShell
Admin SharePoint 2010 with PowerShellAdmin SharePoint 2010 with PowerShell
Admin SharePoint 2010 with PowerShell
Concentrated Technology
 
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
Joel Oleson
 
Windows PowerShell - Billings .NET User Group - August 2009
Windows PowerShell - Billings .NET User Group - August 2009Windows PowerShell - Billings .NET User Group - August 2009
Windows PowerShell - Billings .NET User Group - August 2009
John Clayton
 
Inventory your network and clients with PowerShell
Inventory your network and clients with PowerShellInventory your network and clients with PowerShell
Inventory your network and clients with PowerShell
Concentrated Technology
 
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...
Microsoft TechNet
 
Windows Server 2008 Management
Windows Server 2008 ManagementWindows Server 2008 Management
Windows Server 2008 Management
Hi-Techpoint
 
Windows Server 2008 Management
Windows Server 2008 ManagementWindows Server 2008 Management
Windows Server 2008 Management
Hi-Techpoint
 
Windows PowerShell Remoting Presentation.pdf
Windows PowerShell Remoting Presentation.pdfWindows PowerShell Remoting Presentation.pdf
Windows PowerShell Remoting Presentation.pdf
Syahri Ramadhan
 
Intro to PowerShell
Intro to PowerShellIntro to PowerShell
Intro to PowerShell
Adam Preston
 
Power Shell for System Admins - By Kaustubh
Power Shell for System Admins - By KaustubhPower Shell for System Admins - By Kaustubh
Power Shell for System Admins - By Kaustubh
Kaustubh Kumar
 
Powershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge ClubPowershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge Club
Essam Salah
 
Power shell training
Power shell trainingPower shell training
Power shell training
David Brabant
 
PowerShell for SharePoint Developers
PowerShell for SharePoint DevelopersPowerShell for SharePoint Developers
PowerShell for SharePoint Developers
Boulos Dib
 
Using SCCM 2012 r2 to Patch Linux, UNIX and Macs
Using SCCM 2012 r2 to Patch Linux, UNIX and MacsUsing SCCM 2012 r2 to Patch Linux, UNIX and Macs
Using SCCM 2012 r2 to Patch Linux, UNIX and Macs
Lumension
 
Practical management of development & QA environments for SharePoint 2013
Practical management of development & QA environments for SharePoint 2013Practical management of development & QA environments for SharePoint 2013
Practical management of development & QA environments for SharePoint 2013
SharePointRadi
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
SharePoint Saturday NY
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
SharePoint Saturday NY
 
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
Joel Oleson
 
Windows PowerShell - Billings .NET User Group - August 2009
Windows PowerShell - Billings .NET User Group - August 2009Windows PowerShell - Billings .NET User Group - August 2009
Windows PowerShell - Billings .NET User Group - August 2009
John Clayton
 
Ad

More from Concentrated Technology (12)

Wsus best practices
Wsus best practicesWsus best practices
Wsus best practices
Concentrated Technology
 
Top ESXi command line v2.0
Top ESXi command line v2.0Top ESXi command line v2.0
Top ESXi command line v2.0
Concentrated Technology
 
Supporting SQLserver
Supporting SQLserverSupporting SQLserver
Supporting SQLserver
Concentrated Technology
 
Securely connecting to apps over the internet using rds
Securely connecting to apps over the internet using rdsSecurely connecting to apps over the internet using rds
Securely connecting to apps over the internet using rds
Concentrated Technology
 
Rapidly deploying software
Rapidly deploying softwareRapidly deploying software
Rapidly deploying software
Concentrated Technology
 
Prepping software for w7 deployment
Prepping software for w7 deploymentPrepping software for w7 deployment
Prepping software for w7 deployment
Concentrated Technology
 
PowerShell crashcourse
PowerShell crashcoursePowerShell crashcourse
PowerShell crashcourse
Concentrated Technology
 
PowerShell and WMI
PowerShell and WMIPowerShell and WMI
PowerShell and WMI
Concentrated Technology
 
Managing SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAManaging SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBA
Concentrated Technology
 
Implementing dr w. hyper v clustering
Implementing dr w. hyper v clusteringImplementing dr w. hyper v clustering
Implementing dr w. hyper v clustering
Concentrated Technology
 
Iis implementation
Iis implementationIis implementation
Iis implementation
Concentrated Technology
 
Hyper v r2 deep dive
Hyper v r2 deep diveHyper v r2 deep dive
Hyper v r2 deep dive
Concentrated Technology
 

Recently uploaded (20)

Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 

Automating Active Directory mgmt in PowerShell

  • 1. Automating Active Directory Management in Windows PowerShell Don Jones ConcentratedTech.com Pre-requisites for this presentation: 1) Familiarity with AD administration 2) Basic understanding of how to use Windows PowerShell Level: Intermediate
  • 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. About the Instructor Don Jones Contributing Editor, technetmagazine.com IT author, consultant, and speaker Co-founder of Concentrated Technology Seven-time recipient of Microsoft ’s Most Valuable Professional (MVP) Award Author and Editor-in-Chief for Realtime Publishers Trainer for www.CBTNuggets.com
  • 4. About this Session Primarily demo – not slides  We ’ll start with some key functional concepts, and move right into the “how-to” Bring your questions – anytime is the time to ask them! Don ’t save ‘em for the end. We ’ll take a quick break halfway through
  • 5. Start Thinking Since we ’re mostly doing demos, start thinking of AD administrative tasks you’d like to automate I ’ll take your suggestions and construct some demos on the fly
  • 6. Cool… I ’ll capture everything I type in the shell into a text file, and save all of my scripts There ’s no need for you to copy down anything I do It ’ll all be available for download from my Web site after the show URL is on the last slide, and there are “reminder” cards if you’d like to take one Now let ’s go…
  • 7. Requirements Windows PowerShell v2 Windows 7 or Windows Server 2008 R2 PowerShell v2 is available back to WinXP You need a Win7 or Win2008R2 machine to run the commands I ’ll be showing – at least one such machine in your environment Compatible Domain Controller Windows Server 2008 R2 Windows Server 2008 (w/Gateway Service) Windows Server 2003 (w/Gateway Service)
  • 8. Gateway Service The PowerShell AD commands “talk” to a Gateway Service Ships with Win2008R2 Available for Win2008/Win2003 – you do not need a 2008 R2 domain controller http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=008940c6-0296-4597-be3e-1d24c1cf0dda
  • 9. Managing from Vista/XP? No problem – get PowerShell v2 installed and I ’ll show you how you can use these older versions to run the AD commands This ’ll come at the end PowerShell v2: http://support.microsoft.com/kb/968929 Win2003, Win2008, WinXP, Win2003, Vista Preinstalled w/Win2008R2 and Win7
  • 10. First: The AD Module This module is installed with AD in Win2008R2, and with the RSAT on Win7 Import-Module ActiveDirectory Adds a PSDrive provider an several dozen new cmdlets Using it a lot? Put the Import-Module command into your PowerShell profile script
  • 11. Second: The AD: Drive A drive (AD:) is automatically mapped to your logon domain You can map additional drives to other domains Change to the AD: drive and run New-PSDrive to do so You can specify alternate credentials for the drive mapping
  • 12. What ’s the Drive For? The drive is useful for managing ACLs using Get-ACL and Set-ACL It ’s primary purpose, however, is to “remember” the credentials you used to map the drive in the first place Whenever you are “in” an AD drive, any AD cmdlets you run will automatically use the drive’s credentials Saves you from having to specify a –credential parameter for every command!
  • 13. Third: The AD Cmdlets Let ’s see the cmdlets added by this module They come with full help, including detailed usage examples RTFM – The help is your friend!!! Let ’s play with a few of these cmdlets to get a feel for how they work Remember, you can always specify –credential, but if you ’re “in” an AD drive, it’ll use those credentials automatically
  • 14. Pipeline Input Most AD cmdlets accept pipeline input, meaning you don ’t have to specify parameters – you can pipe data in Each parameter can attach to pipeline input “ByValue” or “ByPropertyName” Let ’s look at the differences with a very cool example
  • 15. ByPropertyName This requires input objects ’ property names to match the parameter names What if they don ’t? Use Select-Object to copy an existing property to a new one having a matching name Let ’s see another tres cool example
  • 16. Gotchas New-ADUser ’s docs don’t say that –Name is required – it is -samAccountName is not required – but it is. Let ’s see why.
  • 17. Gotchas By default, most Get-AD* cmdlets only pull over a subset of attributes Use the –property parameter (e.g., -prop *) to pull over more This raises the load on the responding domain controller – use with some caution Let ’s see
  • 18. Best Practice Always use –filter to minimize what ’s brought back by a Get-AD* cmdlet (that’s why –filter is a required parameter) Don ’t rely on –filter * in a production environment -filter uses standard PowerShell comparison operators Let ’s see
  • 19. Tip If you don ’t know LDAP naming conventions, this is a good time to learn CN = Canonical Name (user, group, container) OU = organizational unit DC = DNS domain name component Cn=DonJ,ou=Sales,ou=West,dc=company,dc=com Work from the more specific to the least specific (object to top-level domain)
  • 20. Pipeline Output Many AD cmdlets don ’t normally produce output -passThru forces them to output whatever object they created or whatever object was input This enables powerful command chains – one liners that accomplish the work of a complicated script Let ’s see!
  • 21. Passwords Cmdlets which accept a password require it as a SecureString Use ConvertTo-SecureString string –force to create a secure string Let ’s see…
  • 22. Demos, Demos, Demos Let ’s take some of your suggestions for demos We ’ll also make sure we run through at least one quick demo for each major category of cmdlets We ’ve got the time – so you’ll get to see how everything works Remember, this is all going into a transcript and I ’m saving my script files – download URL at the end!
  • 23. Using an Older OS? Provided you have: A domain controller running the Gateway Service At least one Win7 or Win2008R2 machine You can use the AD commands on XP, Vista, 2003, and 2008 RTM Using a feature called implicit remoting Establish a PSSession remoting connection to the Win7 or Win2008R2 machine “ Import” the AD commands from the remote machine
  • 25. Step 1 Establish a session to a remote machine that has the cmdlets Tell the remote session to import the AD module
  • 26. Step 2 Export the AD commands to an Implicit Remoting Module – this is a module that lives on your local disk PowerShell will create this in your Documents folder under WindowsPowerShell/Modules
  • 27. Step 3 To use the remote commands, make sure the remote machine is running Import the module that ’s on your local computer Notice that you specify a prefix for the remote commands New-ADUser is now New-RemADUser Helps distinguish remote commands
  • 28. Help? You can ’t get help on remote commands until the remote session is running Get the remote session running by trying to run a remote command Break out of the command if you don ’t really want to run it
  • 29. Running Commands What ’s on your local computer is a “pointer” to the real cmdlet running on the remote machine The cmdlet execution takes place remotely; you see the results on your computer Great way to run commands that don ’t, or can’t, exist on your local machine – but which do exist on another machine on the network Great reason to get one Win2008R2 DC in the environment
  • 30. Finished? The remote session will close as soon as your local PowerShell session closes This all requires that PowerShell remoting be set up in advance – that ’s a whole separate session!
  • 31. Q&A Last chance for Q&A Also a last chance for some additional demos
  • 32. Thank You! Please feel free to pick up a card if you ’d like copies of my session materials I ’ll be happy to take any last questions while I pack up Please complete and submit an evaluation form for this and every session you attend!
  • 33.  
  • 34. 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.
  • #33: 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.