We had to add some variables to get it to work
Add-PSSnapin Microsoft.Crm.PowerShell
$secpasswd = ConvertTo-SecureString "XXXXXXXXXXXXXXXXXXX" -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential ("domain\ID", $secpasswd)
$setting = Get-CrmSetting -Credential $mycreds -DwsServerUrl
http://server -SettingType DashboardSettings
$setting.MaximumControlsLimit = 9
Set-CrmSetting -Credential $mycreds -DwsServerUrl
http://server -Setting $setting