Submitted by Edwin Young, Microsoft
Microsoft Lync Server 2010 is a pretty complicated product, and has quite a lot of different options that can be configured. One problem you’ll run into while getting started is working out where the option is that you’re looking for.
Let’s say that in preparation fro an upcoming all-hands meeting you’re trying to check, and maybe change, the maximum meeting size permitted. As a first step, you can try and find all the relevant cmdlets using Get-Command:
PS > Get-Command *conferencing*
CommandType Name
----------- ----
Cmdlet Get-CsConferencingConfiguration
Cmdlet Get-CsConferencingPolicy
Cmdlet Get-CsDialInConferencingAccessNumber
Cmdlet Get-CsDialInConferencingConfiguration
Cmdlet Get-CsDialInConferencingDtmfConfiguration
Cmdlet Get-CsDialInConferencingLanguageList
Cmdlet Grant-CsConferencingPolicy
Cmdlet New-CsConferencingConfiguration
Cmdlet New-CsConferencingPolicy
Cmdlet New-CsDialInConferencingAccessNumber
Cmdlet New-CsDialInConferencingConfiguration
Cmdlet New-CsDialInConferencingDtmfConfiguration
Cmdlet Remove-CsConferencingConfiguration
Cmdlet Remove-CsConferencingPolicy
Cmdlet Remove-CsDialInConferencingAccessNumber
Cmdlet Remove-CsDialInConferencingConfiguration
Cmdlet Remove-CsDialInConferencingDtmfConfiguration
Cmdlet Set-CsConferencingConfiguration
Cmdlet Set-CsConferencingPolicy
Cmdlet Set-CsDialInConferencingAccessNumber
Cmdlet Set-CsDialInConferencingConfiguration
Cmdlet Set-CsDialInConferencingDtmfConfiguration
Cmdlet Test-CsDialInConferencing
But if it’s not obvious which command you want, this little 1-line script may help:
PS > $params = Get-Command -CommandType Cmdlet *-Cs* | % { $n = $_.Name ; $_.Parameters.Values | % { Add-Member -in $_ noteproperty CmdletName $n; $_ } }
This can be read as follows:
Get-command -CommandType Cmdlet *-Cs* | # get all the communications server cmdlets, and pipe them into...
% { $n = $_.Name ; $_.Parameters.Values | # for each cmdlet, remember its name, then get all the parameters it takes, and pipe them into...
% { Add-Member -in $_ noteproperty CmdletName $n; $_ } # for each parameter, add the name of the cmdlet it comes from to the parameter object and output it
}
After this, the $params variable contains a list of all the parameters that all of our cmdlets accept. We can use this to search for what we want:
PS > $params | where { $_.Name -like "*meeting*" } | select Name,CmdletName
Name CmdletName
---- ----------
DisableMeetingSubjectAndLocation New-CsClientPolicy
AllowUserToScheduleMeetingsWithAppSharing New-CsConferencingPolicy
AllowAnonymousParticipantsInMeetings New-CsConferencingPolicy
AllowExternalUsersToRecordMeeting New-CsConferencingPolicy
MaxMeetingSize New-CsConferencingPolicy
MaxScheduledMeetingsPerOrganizer New-CsUserServicesConfiguration
DisableMeetingSubjectAndLocation Set-CsClientPolicy
MeetingPsomPort Set-CsConferenceServer
AllowUserToScheduleMeetingsWithAppSharing Set-CsConferencingPolicy
AllowAnonymousParticipantsInMeetings Set-CsConferencingPolicy
AllowExternalUsersToRecordMeeting Set-CsConferencingPolicy
MaxMeetingSize Set-CsConferencingPolicy
MaxScheduledMeetingsPerOrganizer Set-CsUserServicesConfiguration
You can read that as “get all the parameters, select the ones with ‘meeting’ somewhere in their name, and print out the parameter name and cmdlet name.”
From that, it looks like we need to run:
PS > Set-CsConferencingPolicy -MaxMeetingSize 500
You can also use this to find other interesting tidbits, like this:
PS > $standardparams = "WhatIf", "Verbose", "Debug", "Confirm", "Force", "ErrorAction", "WarningAction", "ErrorVariable", "WarningVariable", "OutBuffer", "OutVariable", "Instance", "Identity"
PS > $params | where { $_.CmdletName -like "Set-*" -and $standardparams -notcontains $_.Name } | measure
Count : 792
Average :
Sum :
Maximum :
Minimum :
Property :
You can read this as “find each parameter to a Set- cmdlet which is not a ‘standard’ PowerShell parameter, and count them.”
Which indicates that at the time of writing, we have approximately 792 configurable properties in the system.
(By the way, there’s nothing specific to Lync Server here, apart from looking for *-Cs* – this will work for any set of cmdlets)
Enjoy!