liquidcourage1 Posted September 11, 2013 Report post Posted September 11, 2013 Is it possible to automate Site Server creation with PowerShell? I'm looking at creating Distribution Points at over 150 sites. Automating this would make it much faster and easier on everyone. My plan is to virtualize the servers and have them already staged at each site (Windows Server 2012, WDS and other pre-reqs already applied). The goal is to run a script adding the server as a Site System and also making it a Distribution Point and possibly a Software Update Point as well. Quote Share this post Link to post Share on other sites More sharing options...
Peter van der Woude Posted September 11, 2013 Report post Posted September 11, 2013 There is even a complete CMDLET for adding a new Distribution Point. Neil Peterson wrote a nice post about using that CMDLET: http://blogs.technet.com/b/neilp/archive/2013/03/23/at-long-last-add-cmdistributionpoint-powershell-cmdlet-included-in-configuration-manager-sp1-cu1.aspx 1 Quote Share this post Link to post Share on other sites More sharing options...
liquidcourage1 Posted September 11, 2013 Report post Posted September 11, 2013 Awesome! Thanks so much. I think this is going to be perfect. I'll have to update to CU1, but that's no problem at all since this is a new deployment. Quote Share this post Link to post Share on other sites More sharing options...
liquidcourage1 Posted September 18, 2013 Report post Posted September 18, 2013 Okay... so I've starting testing this commandlet using PowerShell, but it's running into issues. I also have an open thread on TechNet, but no one has figured this out yet. Here's the exact string of what's being entered and the error in PowerShell: PS C:\Windows\system32> New-CMSiteSystemServer –ServerName "Win7-SCCM-Test" -SiteCode "DP1" New-CMSiteSystemServer : Cannot validate argument on parameter 'ServerName'. System.Management.Automation.ValidationMetadataException At line:1 char:36 + New-CMSiteSystemServer –ServerName "Win7-SCCM-Test" -SiteCode "DP1" + ~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidData: ( [New-CMSiteSystemServer], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.ConfigurationManagement.Cmdlets.HS.Commands.N ewSiteSystemServerCommand So in essence, the parameter "ServerName" (which is a required parameter for obvious reasons) is failing for some reason and we can't figure it out. I'd like to be able to use this on a long list of servers that will become Site Servers and eventually Distribution Points/Software Update Points. Quote Share this post Link to post Share on other sites More sharing options...
liquidcourage1 Posted September 19, 2013 Report post Posted September 19, 2013 So... the short story is that I have figured this out with some help on TechNet. First of all, it's easier if you run PowerShell from the Configuration Manager Console as you can see in the picture below (source link here: http://cm12sdk.net/?page_id=1623) : Or insure that you're running ALL commands from the appropriate directory and then connect to the Primary or CAS server. Type the following commands in PowerShell Console C: cd ‘.\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin’ Import-Module .\ConfigurationManager.psd1 Set-Location XXX: Now you are ready to manage your Configuration Manager infrastructure Once you're in the right location, the server name input must be the FQDN if you want to mitigate errors. The SiteCode parameter needs to be based on your Primary site or secondary site code that the system will connect to. So in my case I altered my code. The CSV format is here: DPServerName,DPSiteCode Server1, XX1 Server2, XX2 Server3, XX1 Code here: $csv_path = 'c:\scripts\test.csv' $csv_import = Import-CSV $csv_path ForEach ($item in $csv_import) { $DPServerName = $item.DPServerName $DPSiteCode = $item.DPSiteCode New-CMSiteSystemServer -ServerName $DPServerName -SiteCode $DPSiteCode } My next phase is to then use Powershell to do the same process and make them distribution and software update points. When I get a bit better at PowerShell, I'd like to integrate that step into this code as well. Quote Share this post Link to post Share on other sites More sharing options...