O'Reilly logo

Windows PowerShell in Action by Bruce Payette

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix B. Admin examples

Although this book is not intended to be a solutions cookbook, it’s always handy to have a few domain-specific examples. This section contains a number of short examples showing how common administration tasks might be accomplished with PowerShell.

Getting active directory domain information

The following script will list the active directory information for a list of computers. If no computer names are provided, it shows the domain information for this computer. You can optionally specify a set of properties to return.

To display the domain information for the current host:

Get-DomainInfo

or

Get-DomainInfo .

To display the domain information for a set of machines:

Get-DomainInfo machine1, machine2, machine3

To get the domain ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required