I am attempting to create a bunch of Site System Servers and automation within PowerShell would be perfect with the new CMDLETS, but I'm getting an error in my tests.
I have a CSV File with System Name and it's new site code:
Win7-SCCM-Test,DP1
The system above is a Windows 7 x64 VM that's up and running and even has the SCCM 2012 agent installed and is reporting perfectly.
Here's the code I would like to use and eventually expand the CSV file to include the hundreds of systems that we'll need:
$csv_info = Import-Csv c:\scripts\test.csv -Header DPServerName,DPSiteCode foreach ($line in $csv_info) { New-CMSiteSystemServer ServerName $line.DPServerName -SiteCode $line.DPSiteCode }
I'm getting a PowerShell error at the ServerName parameter:
New-CMSiteSystemServer : Cannot validate argument on parameter 'ServerName'. System.Management.Automation.ValidationMetadataException At line:1 char:1 + New-CMSiteSystemServer + ~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [New-CMSiteSystemServer], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.ConfigurationManagement.Cmdlets.HS.Commands.N ewSiteSystemServerCommand
I'm learning powershell and I can't find anything meaningful as of yet to determine what I need to change to allow this parameter to pass.