Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Microsoft System Center Powershell Essentials

You're reading from   Microsoft System Center Powershell Essentials Efficiently administer, automate, and manage System Center environments using Windows PowerShell

Arrow left icon
Product type Paperback
Published in Apr 2015
Publisher Packt
ISBN-13 9781784397142
Length 140 pages
Edition 1st Edition
Arrow right icon
Toc

Table of Contents (10) Chapters Close

Preface 1. Setting up the Environment to Use PowerShell 2. Administration of Configuration Manager through PowerShell FREE CHAPTER 3. Scenario-based Scripting for SCCM Administration 4. Administration of Operations Manager through PowerShell 5. Scenario-based Scripting for SCOM Administration 6. Administration of Service Manager through PowerShell 7. Scenario-based Scripting for SCSM Administration 8. Best Practices Index

Scenario 1 – adding multiple distribution points to a distribution point group


This is one common scenario where Configuration Manager administrators are required to add multiple distribution points to a distribution point group (DP group). A text file with the distribution point list can be used as the input to the script.

Prescripting activities

Create a text file at D:\PowerShell\DPFile.txt (you can use your convenient location) and populate the file with the distribution points to be added to the DP group.

To show you a sample, DPFile.txt should contain DP names, as follows:

GURU.COM
DP1.GURU.COM
DP2.GURU.COM

Also, it is important to note that we should enter one DP name per line. Our sample file will look something like the following screenshot:

Assumption

We will assume the distribution point group is named Test Distribution Group and the text file location as D:\PowerShell. Look at the following code:

$FilePath = "D:\PowerShell\DPFile.txt"
$DPNames = Get-Content –path $FilePath
ForEach(...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime