Robert Posted August 4, 2016 #1 Share Posted August 4, 2016 Hey Folks, is there anybody who's got an idea of how to create functionprofiles with powershell? On hosted swyxware it's necessary to care about them and I want them to be the same on multiple Servers... I haven't found any cmdlets to achieve this yet - maybe i've searched for the wrong word`s... Link to comment Share on other sites More sharing options...
Most Valued User Martin Posted August 5, 2016 Most Valued User #2 Share Posted August 5, 2016 Unfortunately there are no cmdlets in the SwyxWare Powershell module for that. The ConfigDataStoreAPI on which the PS module is based on has the necessary APIs however. But they are not easy to use. You could probably do something like this: Get the enumerator object and execute a query to fill it $e. = $LibManager.GetFeatureProfileEnum() $e.ExecuteAllFilter((new-object "OrderByList)) Now the PrimaryCollection member is filled and you could list them $e.PrimaryCollection That's the easy part. Each object in the collection is a featureprofileEntry object. These are your feature profiles. Each profile object has a collection of FeatureEntry objects which define the features included in that profile. The FeatureEntry object has a feature ID. The IDs are static constants on this object: [SWConfigDataSharedLib.Config.FeatureListBase] To add a feature to an existing profile you would do something like this: $profile = $e.PrimaryCollection | where Name -eq "MyProfileName" $FeatureEntryToAdd = new-object "SWConfigDataClientLib.Proxies.FeatureProfiles.FeatureEntry" $FeatureEntryToAdd.FeatureID = [SWConfigDataSharedLib.Config.FeatureListBase]::SClFeatureOptionPackSwyxECR $profile.FeatureEntryCollection.Add($FeatureEntryToAdd) $profile.Update($true) Creating a new profile is similar, you create a new SWConfigDataClientLib.Proxies.FeatureProfiles.FeatureProfileEntry object, add the feature as shown above, add it to the FeatureProfileEnumerator object and call the Update($true) method to write everything back. Be careful, you could easily mess up your SwyxWare setup Link to comment Share on other sites More sharing options...
Most Valued User Sebastian Dreier Posted November 17, 2016 Most Valued User #3 Share Posted November 17, 2016 Hello Robert, I have good news for you. The upcoming SwyxWare 2015 R40 will contain the following new FeatureProfile commandlets: Add-IpPbxFeatureProfile Add-IpPbxFeatureToProfile Get-IpPbxDefaultFeatureProfile Get-IpPbxFeature Get-IpPbxFeatureProfile New-IpPbxFeatureProfile Remove-IpPbxFeatureFromProfile Remove-IpPbxFeatureProfile Set-IpPbxDefaultFeatureProfile Update-IpPbxFeatureProfileUsage Example $profile = New-IpPbxFeatureProfile -FeatureProfileName "TestProfile" -UserLimit 10 Add-IpPbxFeatureToProfile -FeatureProfileEntry $profile -FeatureName "SwyxBF (BasicFunctionality)" Add-IpPbxFeatureToProfile -FeatureProfileEntry $profile -FeatureName "SwyxBCR (Basic Call Routing)" Add-IpPbxFeatureToProfile -FeatureProfileEntry $profile -FeatureName "SwyxVoicemail" Add-IpPbxFeatureProfile -FeatureProfileEntry $profile Creates a new feature profile object named "TestProfile", assigns the listed features and adds it to the IpPbx server.How to assign the new "TestProfile" to a user? $FeatureProfileEntry = Get-IpPbxFeatureProfile -FeatureProfileName "TestProfile" $UserEntry = Get-IpPbxUser -UserName "UserA" $UserEntry.FeatureProfileID = $FeatureProfileEntry.FeatureProfileID Update-IpPbxUser -UserEntry $UserEntry Link to comment Share on other sites More sharing options...
Robert Posted November 17, 2016 Author #4 Share Posted November 17, 2016 Hey Sebastian, that sounds great! looks like it will make automation much easier! Thanks a lot for integrating this! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.