Can someone please tell me why this doesn't work?
#Import ConfigMgr PSH Module
Import-Module
$env:SMS_ADMIN_UI_PATH.Replace("\bin\i386","\bin\configurationmanager.psd1")
#Get the CMSITE SiteCode
$SiteCode = Get-PSDrive -PSProvider CMSITE
# Change the connection context
Set-Location "$($SiteCode.Name):\"
$Boundaries = Get-CMBoundary
foreach($item in $Boundaries){
New-CMDeviceCollection -Name $Boundaries.DisplayName
-LimitingCollectionName "All Systems"
}
Here's the error:
New-CMDeviceCollection : Cannot convert 'System.Object[]' to the type
'System.String' required by parameter 'Name'. Specified method is not supported.
At line:10 char:34
+ New-CMDeviceCollection -Name $Boundaries.DisplayName
-LimitingCollectionName ...
________________________________
John Marcum
Sr. Desktop Architect
Bradley Arant Boult Cummings LLP
________________________________
________________________________
Confidentiality Notice: This e-mail is from a law firm and may be protected by
the attorney-client or work product privileges. If you have received this
message in error, please notify the sender by replying to this e-mail and then
delete it from your computer.