An Active Directory Health Check through PowerShell Jeff Wouters | MVP Windows PowerShell [CEO |...

8
An Active Directory Health Check through PowerShell Jeff Wouters | MVP Windows PowerShell [CEO | Automation Consultant] @ Methos BSc, MCT, MVP, MCSA, MCSE, MCTS, MCITP

Transcript of An Active Directory Health Check through PowerShell Jeff Wouters | MVP Windows PowerShell [CEO |...

Page 1: An Active Directory Health Check through PowerShell Jeff Wouters | MVP Windows PowerShell [CEO | Automation Consultant] @ Methos BSc, MCT, MVP, MCSA, MCSE,

An Active Directory Health Check

through PowerShell

Jeff Wouters | MVP Windows PowerShell[CEO | Automation Consultant] @ Methos

BSc, MCT, MVP, MCSA, MCSE, MCTS, MCITP

Page 2: An Active Directory Health Check through PowerShell Jeff Wouters | MVP Windows PowerShell [CEO | Automation Consultant] @ Methos BSc, MCT, MVP, MCSA, MCSE,

possessod

• PowerShell Script of System Center Documentation• PSSOSCD

Page 3: An Active Directory Health Check through PowerShell Jeff Wouters | MVP Windows PowerShell [CEO | Automation Consultant] @ Methos BSc, MCT, MVP, MCSA, MCSE,

Whatcha doin’?

• Users• Groups• Trusts• Replication• Subnets• Sites• DC’s• GPO’s

Page 4: An Active Directory Health Check through PowerShell Jeff Wouters | MVP Windows PowerShell [CEO | Automation Consultant] @ Methos BSc, MCT, MVP, MCSA, MCSE,

Bumps along the way…

• LDAP + ForEach + Where-Object =

• Maximum LDAP query results…

Page 5: An Active Directory Health Check through PowerShell Jeff Wouters | MVP Windows PowerShell [CEO | Automation Consultant] @ Methos BSc, MCT, MVP, MCSA, MCSE,

Execution time vs …

• Cmdlets• ADSI• LDAP• .NET

Page 6: An Active Directory Health Check through PowerShell Jeff Wouters | MVP Windows PowerShell [CEO | Automation Consultant] @ Methos BSc, MCT, MVP, MCSA, MCSE,

ForEach vs ForEach-Object

• ForEach = Slower• ForEach-Object = More memory consuming

• Note: This is a huge over-simplification• Watch the Hey!ScriptingGuy blog…

Page 7: An Active Directory Health Check through PowerShell Jeff Wouters | MVP Windows PowerShell [CEO | Automation Consultant] @ Methos BSc, MCT, MVP, MCSA, MCSE,

The problem is choice…

• Backwards compatibility is a bitch!*** Start upgrading already!!! ***

Which PowerShell versions to support?Which Operating Systems to support?Which Domain Level to support?Include GPO?Include DNS?Include DHCP?Support domains and/or forests?

Page 8: An Active Directory Health Check through PowerShell Jeff Wouters | MVP Windows PowerShell [CEO | Automation Consultant] @ Methos BSc, MCT, MVP, MCSA, MCSE,