Script repository
The script preserves the name of assigned Skype for Business Conferencing policy in a user property. To execute the script, create a business rule, custom command or scheduled task configured for the User object type.
Parameters
$skypeServer- the fully-qualified domain name (FQDN) of your Lync Server.$propertyName- the name of the property that will be used to store the Conferencing policy name.
$skypeServer = "lyncserver.domain.com" # TODO: modify me
$propertyName = "adm-CustomAttributeText1" # TODO: modify me
try
{
# Connect to the Lync Server
$sessionOptions = New-PSSessionOption -SkipRevocationCheck -SkipCACheck -SkipCNCheck
$session = New-PSSession -ConnectionUri https://$skypeServer/ocspowershell `
-SessionOption $sessionOptions -Authentication NegotiateWithImplicitCredential
Import-PSSession -session $session
# Get the Conferencing Policy
$conferencingPolicy = (Get-CsUser -Identity "%userPrincipalName%").ConferencingPolicy
# Update the attribute
$Context.TargetObject.Put($propertyName, $conferencingPolicy)
$Context.TargetObject.SetInfo()
}
finally
{
# Close the remote session and release resources
Remove-PSSession -Session $session
}
Comments 0
You must be signed in to comment.