Sebastian Dreier

Most Valued Users
  • Content Count

    68
  • Joined

  • Last visited

  • Days Won

    12

Sebastian Dreier last won the day on July 20

Sebastian Dreier had the most liked content!

Community Reputation

12 Good

About Sebastian Dreier

  • Rank
    Advanced Member

Contact Methods

  • MSN
    sdreier2001
  • Website URL
    www.dreier-it.com
  • Skype
    sdreier2001

Profile Information

  • Gender
    Male
  • Location
    Beckum

Recent Profile Visitors

792 profile views
  1. Sebastian Dreier

    All groups from ConfigDataStore

    Hallo Marius, ich kann das Problem bei mir nicht nachstellen. Daher habe ich für dich ein spezielles Demo App gebaut, welches definitiv funktioniert. Dieses findest du im Anhang dieser Nachricht (inkl. Source Code). Ich wünsche dir viel Erfolg. Kind regards Sebastian Dreier SwyxCdsDemoApp.7z
  2. Sebastian Dreier

    All groups from ConfigDataStore

    Hello Marius, the group member information is available as property on every UserEntry: var cdsLib = new CDSLib(); var userList = cdsLib.GetUsers("%"); for (var userEntry in userList) { // userEntry.MembershipEntryCollection } Important performance note Do not call the "GetUsers" method too often in a row. It is far better to get all the users in one collection and to work on that. Kind regards Sebastian Dreier
  3. Sebastian Dreier

    All groups from ConfigDataStore

    Hello Marius, quickly create a sample class that should fit your needs: using SWConfigDataClientLib; using SWConfigDataClientLib.Data; using SWConfigDataClientLib.Proxies.Admin; using SWConfigDataClientLib.Proxies.Users; using System; namespace IpPbx.Samples.Shared { public class CDSLib { /// <summary> /// The CDS Client LibManager is the central class of the CDS Client API. /// It contains methods to address the server and to authenticate users. /// You use LibManager to create instances of classes for retrieval and /// manipulation of IpPbx configuration items. The LibManager should be the /// first class to instantiate. It checks the configuration and initiates /// the tracing of the client application. /// </summary> private LibManager libManager; /// <summary> /// Initializes a new instance of the <see cref="CDSLib" /> class. /// </summary> /// <param name="userName">Username (SwyxIt Login)</param> /// <param name="password">Password (SwyxIt Login)</param> /// <param name="serverName">SwyxServer Address (FQDN or IP)</param> public CDSLib(string userName = "", string password = "", string serverName = "") { Init(userName, password, serverName); } /// <summary> /// Initialisation /// </summary> /// <param name="userName">Username (SwyxIt Login)</param> /// <param name="password">Password (SwyxIt Login)</param> /// <param name="serverAddress">SwyxServer Address (FQDN or IP)</param> private void Init(string userName, string password, string serverAddress) { // Check if server address is empty if (string.IsNullOrWhiteSpace(serverAddress) || serverAddress.Equals("localhost", StringComparison.InvariantCultureIgnoreCase)) { serverAddress = "127.0.0.1"; } // Set default authentication mode to trusted SProxyObject.AuthenticationMode authenticationMode = SProxyObject.AuthenticationMode.Trusted; if (serverAddress == "127.0.0.1") { authenticationMode = SProxyObject.AuthenticationMode.TrustedLocal; } // If username and password are available the authentication // mode must be changed to UsernamePassword if (!string.IsNullOrWhiteSpace(userName) && !string.IsNullOrWhiteSpace(password)) { authenticationMode = SProxyObject.AuthenticationMode.UsernamePassword; } // Create and configure new LibManager object libManager = new LibManager() { BaseProtocol = SProxyObject.BaseProtocol.TCP, Username = userName, Password = password, WSBaseUrl = serverAddress, AuthenticationMode = authenticationMode }; } /// <summary> /// Returns a collection of ippbx users filtered by name /// </summary> /// <param name="nameFilter">Name of the IpPbx user your are /// searching for (SQL Wildcards e.g. "%" can be used here)</param> public UserPrimaryCollection GetUsers(string nameFilter) { // Get UserEnum object from LibManager UserEnum userEnum = libManager.GetUserEnum(); try { userEnum.ExecuteNameFilter(nameFilter, new OrderByList()); return userEnum.PrimaryCollection; } catch (Exception) { // Add your tracing here throw; } finally { // IMPORTANT // If you free resources here you will NOT be able // to save changes anymore. Every UserEntry has a // reference to his parent UserEnum to save changes. // If the Enum is released the reference will be broken. // PERFORMANCE NOTE // For "read-only" purposes the AdminFacade should be // used because it is MUCH faster and lightweight. /* Free resources if (userEnum != null) { userEnum.Clear(); userEnum.FreeForReuse(); } */ } } /// <summary> /// Returns all users in one collection (READ ONLY -> BETTER PERFORMANCE) /// </summary> /// <param name="includeUserFileSize">If true the size of the user files in the database is calculated and added</param> public UserAdminView1EntrySortableCollection GetUserView(bool includeUserFileSize) { var adminFacade = libManager.GetAdminFacade(); try { return adminFacade.GetUserAdminView1(includeUserFileSize, out UserDeviceSmallMap userDeviceSmallMap).CreateSortableFilterCollection(); } catch (Exception) { // Add your tracing here throw; } } /// <summary> /// Returns a collection of IpPbx groups filtered by name /// </summary> /// <param name="nameFilter">Name of the IpPbx group your are /// searching for (SQL Wildcards e.g. "%" can be used here)</param> public SWConfigDataClientLib.Proxies.Groups.GroupPrimaryCollection GetGroups(string nameFilter) { // Get enum object from LibManager var groupEnum = libManager.GetGroupEnum(); try { groupEnum.ExecuteNameFilter(nameFilter, new OrderByList()); return groupEnum.PrimaryCollection; } catch (Exception) { // Add your tracing here throw; } finally { // IMPORTANT // If you free resources here you will NOT be able // to save changes anymore. Every entry has a // reference to his parent UserEnum to save changes. // If the Enum is released the reference will be broken. /* Free resources if (groupEnum != null) { groupEnum.Clear(); groupEnum.FreeForReuse(); } */ } } /// <summary> /// Returns all users in one collection (READ ONLY -> BETTER PERFORMANCE) /// </summary> public GroupAdminView1EntrySortableCollection GetGroupView() { var adminFacade = libManager.GetAdminFacade(); try { return adminFacade.GetGroupAdminView1().CreateSortableFilterCollection(); } catch (Exception) { // Add your tracing here throw; } } } } Kind regards Sebastian Dreier
  4. Sebastian Dreier

    Swyxuser mit ADUser verknüpfen

    Hallo in33dhelp, ja es gibt hierfür das folgende Commandlet: # Adds a windows domain account to IpPbx user "Sebastian" Add-IpPbxUserWindowsAccount -UserName "Sebastian" -NTAccount "MYDOMAIN\sebastian" # Adds a windows domain account to IpPbx user "Sebastian" by SID Add-IpPbxUserWindowsAccount -UserName "Sebastian" -NTAccount "S-1-5-21-1866771598-1400282655-2479265699-500" -ContainsSID
  5. Sebastian Dreier

    Tastenbelegung vom Template auf alle User anwenden

    Hallo Manny, das Verhalten ist sogar logisch. Du musst natürlich sicherstellen, dass die Zielbenutzer nicht weniger Leitungstasten haben als der Quellbenutzer: # Connect via Windows Authentication Connect-IpPbx # Get source user entry and user data $sourceUser = Get-IpPbxUser -UserName "Sebastian" $sourceUserData = Get-IpPbxUserData -UserEntry $sourceUser # Get target user entry and user data $targetUser = Get-IpPbxUser -UserName "Inneke" $targetUserData = Get-IpPbxUserData -UserEntry $targetUser # Check Line Keys of target user if ($targetUserData.m_iNumberOfLineKeys -lt $sourceUserData.m_iNumberOfLineKeys) { Set-IpPbxUserLineKeyCount -UserEntry $targetUser -Count $sourceUserData.m_iNumberOfLineKeys } # THE HARD WAY -> JUST SET THE LINE KEY AMOUNT WITHOUT ANY CHECK # Set-IpPbxUserLineKeyCount -UserEntry $targetUser -Count $sourceUserData.m_iNumberOfLineKeys # Receive updated target user data $targetUserData = Get-IpPbxUserData -UserEntry $targetUser # Copy Phone Settings $targetUserData.m_iNumberOfPhoneSettings = $sourceUserData.m_iNumberOfPhoneSettings $targetUserData.m_PhoneSettings = $sourceUserData.m_PhoneSettings # Save changes Set-IpPbxUserData -UserEntry $targetUser -UserData $targetUserData # IMPORTANT # Do not forget to disconnect # This releases memory on the IpPbx server Disconnect-IpPbx Kind regards Sebastian Dreier
  6. Sebastian Dreier

    Tastenbelegung vom Template auf alle User anwenden

    Hallo Manny, du darfst bei dem folgenden Befehl $user nicht in " setzen: Set-IpPbxUserData -UserEntry $user -UserData $userData Des Weiteren rate ich dir dringend dazu nicht einzelne sondern alle Phone Settings zu kopieren. Andernfalls könnte dies zu kuriosen Effekten führen. Hier mein Vorschlag: # Connect via Windows Authentication Connect-IpPbx # Get source user data $sourceUserData = Get-IpPbxUserData -UserName "Sebastian" # Get target user and user data $targetUser = Get-IpPbxUser -UserName "Inneke" $targetUserData = Get-IpPbxUserData -UserEntry $targetUser # Copy Phone Settings $targetUserData.m_iNumberOfPhoneSettings = $sourceUserData.m_iNumberOfPhoneSettings $targetUserData.m_PhoneSettings = $sourceUserData.m_PhoneSettings # Save changes Set-IpPbxUserData -UserEntry $targetUser -UserData $targetUserData # Cleanup Disconnect-IpPbx Kind regards Sebastian Dreier
  7. Sebastian Dreier

    Regel im Call Routing Manager per PS-Script verteilen

    Hallo Manny, du kannst das Call Routing von einem Benutzer auf andere kopieren, allerdings musst du oder der Benutzer diese Regeln manuell aktivieren. Connect-IpPbx $sourceUser = Get-IpPbxUser -UserName "Sebastian" -ReadOnly $targetUser = Get-IpPbxUser -UserName "Inneke" -ReadOnly Copy-IpPbxUserCallRouting -SourceUserEntry $sourceUser -TargetUserEntry $targetUser -Overwrite Disconnect-IpPbx Kind regards Sebastian Dreier
  8. Sebastian Dreier

    Difference between .FreeForReuse() and .Dispose()

    Hello Jörg, the method "FreeForReuse" is a Swyx implementation to release resource on the IpPbx Server. The Dispose method is just the normal C# IDispose implementation and has no effect on the IpPbx Server. I highly recommend to call the "Clear" and "FreeForReuse" method for every Enum object. For LibManager and Facade objects only the "FreeForReuse" method should be called. Examples: // LIB MANAGER INIT var libManager = new LibManager() { BaseProtocol = SProxyObject.BaseProtocol.TCP, Username = "Username", Password = "Password", WSBaseUrl = "ServerAddress", AuthenticationMode = SProxyObject.AuthenticationMode.UsernamePassword }; var adminFacade = libManager.GetAdminFacade(); // SOME FACADE METHODS CALLS adminFacade.FreeForReuse(); adminFacade = null; var userEnum = this.libManager.GetUserEnum(); // SOME ENUM METHODS CALLS userEnum.Clear(); userEnum.FreeForReuse(); userEnum = null; // LIB MANAGER CLEANUP libManager.FreeForReuse(); libManager = null;
  9. Sebastian Dreier

    Namenstasten werden bei Powershell script nicht übernommen

    Hallo Herr Baumgardt, die Tatsache, dass mein Powershell Code bei Ihnen nicht funktioniert bereitet mir etwas Sorgen. Dies deutet möglicherweise daraufhin, dass das UserData Objekt des Template Benutzers "AAA_Muster-Benutzer" korrupt ist. Folglich rate ich Ihnen diesen Benutzer einmal neu anzulegen und meinen Code noch einmal zu testen. P.S.: Ich habe meinen Code mit einer SwyxWare 11.20 getestet. Welche Version ist bei Ihnen im Einsatz? Kind regards Sebastian Dreier
  10. Sebastian Dreier

    Namenstasten werden bei Powershell script nicht übernommen

    Hallo Herr Baumgardt, ich habe den Code soeben noch einmal etwas verändert und erfolgreich auf einer meiner VMs getestet. Bitte prüfen Sie einmal, ob dieser auch bei Ihnen funktioniert. $templateUserName = "AAA_Muster-Benutzer" $newUserName = "TestUser1" $newUserComment = "Test Comment" $newUserInternalNumber = "444" $newUserPublicNumber = "+492525123444" $newUserWindowsAccount = "vm-dreier09\Administrator" # Get user data from template user $templateUserData = Get-IpPbxUserData -Username $templateUserName # Create new user New-IpPbxUser -UserName $newUserName -Comment $newUserComment | Add-IpPbxUser -AddToEveryoneGroup # Set user data from template user Set-IpPbxUserData -UserName $newUserName -UserData $templateUserData # Add internal and public number New-IpPbxInternalNumber -Number $newUserInternalNumber | Add-IpPbxInternalNumberToUser -UserName $newUserName New-IpPbxPublicNumber -PublicNumber $newUserPublicNumber | Add-IpPbxPublicNumber -InternalNumber $newUserInternalNumber # Get new user as UserEntry object $newUserEntry = Get-IpPbxUser -UserName $newUserName # Change line key count Set-IpPbxUserLineKeyCount -UserEntry $newUserEntry -Count 4 # Update speeddial key count Set-IpPbxSpeedDialKeyCount -UserEntry $newUserEntry -SpeedDialKeyCount 250 # Add NT Account for Windows Authentication Add-IpPbxUserWindowsAccount -UserEntry $newUserEntry -NTAccount $newUserWindowsAccount # Remove all existing fax forwardings # Get-IpPbxFaxForwarding -UserEntry $newUserEntry | Remove-IpPbxFaxForwarding # Save changes Update-IpPbxUser -UserEntry $newUserEntry
  11. Sebastian Dreier

    Namenstasten werden bei Powershell script nicht übernommen

    Hallo Herr Baumgardt, mit dem folgenden Code sollte es funktionieren (nicht getestet): <INVALID CODE REMOVED>
  12. Sebastian Dreier

    Modify ActiveCallEntry on Database/Server ?!

    What exactly do you want to modify for outgoing calls? Do you only want to modify the call information internally? Kind regards Sebastian Dreier
  13. Sebastian Dreier

    Using Smartfax or other Email sending fax with SwyxFax

    Hello, you should have a look at the Swyx Powershell Module. It already contains a very easy to use commandlet to send faxes: "Send-IpPbxFax". <# .SYNOPSIS Sends a fax to an internal or external destination. .DESCRIPTION The Send-IpPbxFax cmdlet sends a fax to an internal or external destination. .PARAMETER Sender FaxClientLocalConfigEntry object which contains all relevant sender information. Use the cmdlet "Get-IpPbxFaxClientConfig" to get the correct sender information for your fax. If this parameter is not provided the FaxClientLocalConfigEntry object of the current IpPbx User (the user you used for logon) will be used. .PARAMETER Recipient IpPbxFaxRecipient object which contains detailed recipient information. If this information is needed you can just use the number parameter instead. .PARAMETER Number Use this parameter if you want to send a quick fax without detailed recipient information. .PARAMETER Message Message (Memo) which is printed on the cover page. .PARAMETER FaxFile Use this parameter to attach additional pages to the fax. Therefore you must provide a path to a Structured Fax File (SFF) or a Tagged Image File (TIF). .PARAMETER AddCoverPage Defines if a cover page is added to the fax (true by default). .PARAMETER Priority Sets the priority of the fax (Low/Normal/High). The default is "Normal". .PARAMETER Resolution Defines the quality of the fax (Standard/High). The default is "Standard". .INPUTS [IpPbxFaxRecipient] $Recipient [string] $DestinationNumber .OUTPUTS None .EXAMPLE Send-IpPbxFax -Number "+4923123456789" -Message "This is a test fax number 1." -SenderName "Sebastian" Sends a fax to number "+4923123456789" from sender "Sebastian". The content of the fax is "This is a test fax number 1.". .EXAMPLE $Sender = Get-IpPbxFaxClientConfig -UserName "Sebastian" Send-IpPbxFax -Sender $Sender -Number "+4923123456789" -Message "This is a test fax number 2." -Priority High Sends a fax to number "+4923123456789" from sender "Sebastian" with high priority. The content of the fax is "This is a test fax number 2.". .EXAMPLE Send-IpPbxFax -Number "+4923123456789" -FaxFile "c:\FaxFiles\TestFax3.sff" -Message "This is a test fax number 3." -SenderName "Sebastian" Sends a fax to number "+4923123456789" from sender "Sebastian". The content of the fax is a cover page with the message "This is a test fax number 3.". The following pages is the content of the file "c:\FaxFiles\TestFax3.sff". .EXAMPLE New-IpPbxFaxRecipient -Name "John Doe" ` -Email "john.doe@mycompany.com" ` -Address "John-Doe-Street No. 1" ` -Department "Development" ` -Organization "John Doe Inc." ` -FaxNumber "+4923123456789" ` -PhoneNumber "+4923199999999" | Send-IpPbxFax -Message "This is a test fax number 4." -SenderName "Sebastian" Creates a new recipient "John Doe" and sends him a fax from sender "Sebastian". The content of the fax is "This is a test fax number 4.". #>
  14. Sebastian Dreier

    Modify ActiveCallEntry on Database/Server ?!

    Hello Jörg, users cannot modify ActiveCall Entries even if they have "System Administrator" rights. Only the Swyx Server service can do this. If you want to modify the number/name resolution for calls you have to use GSE scripts. Kind regards Sebastian Dreier
  15. Sebastian Dreier

    get call journal via client api

    Hello, for this you have to use the ConfigDataStore API: https://www.swyx.com/products/support/knowledge-base/article-details/swyxknowledge/kb3216/ The SDK package contains C# samples which are very helpful. Regarding the call journal you should take a look at the "CDSLib.cs" file. It contains sample code for the caller and the redial list. Kind regards Sebastian Dreier