Jump to content

Per Powershell Swyx Verknüpfungstasten setzen


Foley

Recommended Posts

Hey,
für jeden User den wir in unserem System anlegen müssen im nachhinein noch 2 Buttons angepasst werden, zum einen die Beschriftung des Buttons als auch die Befehlszeile.
ich würde das gerne via Powershell lösen.
Unter Userdata finde ich nur folgende Einträge kann ich noch tiefer in die Einstellungen gehen um solche Einstellungen via Skript vorzunehmen.
Würde das tägliche manuelle verändern der Buttons erheblich vereinfachen :)
LG

 

Link to comment
Share on other sites


In der Swyxware Administration kann man in den Eigenschaften der Benutzer unter Tasten '/ Verknüpfungstasten ,die Verknüpfungen vornehmen.
Ihc würde gerne die Befehlszeile und die Beschriftung anpassen.
LG

swyx.png

Link to comment
Share on other sites


  • 1 month later...
  • Most Valued User

Hallo RandomSwyxUser,

 

inzwischen habe ich endlich die Zeit gefunden mir dein Problem einmal näher anzusehen.
Hier eine mögliche Lösung:

Connect-IpPbx

Get-IpPbxUser | ForEach-Object {

    $currentUserEntry = $_

    Write-Host "Updating user '$($currentUserEntry.Name)'..."

    # Get user data
    $userData= Get-IpPbxUserData -UserEntry $currentUserEntry
    
    # Update the configuration of the first shortcut key
    $userData.m_UrlKeySettings[0].Title = "Swyx Website"
    $userData.m_UrlKeySettings[0].CommandLine = "http://www.swyx.com"
    $userData.m_UrlKeySettings[0].CurrentDirectory = ""

    # Save changes
    Set-IpPbxUserData -UserEntry $currentUserEntry -UserData $userData
}

 

Link to comment
Share on other sites


  • 3 weeks later...
Get-IpPbxUserData -Username "user name"
 
  # Update the configuration of the first shortcut key
    $userData.m_UrlKeySettings.Title[0] = "Swyx Website"
    $userData.m_UrlKeySettings.CommandLine[0] = "http://www.swyx.com"
    $userData.m_UrlKeySettings.CurrentDirectory[0] = ""

    # Save changes
    Set-IpPbxUserData -UserName "user name" -UserData $userData

Wenn ich das für einen User ausführe, schmeißt er keine Fehlermeldung jedoch speichert er den Eintrag auch nicht.
LG

 

Link to comment
Share on other sites


  • Most Valued User

Hallo RandomSwyxUser,

so funktioniert es für einen Benutzer:


# Connect to the local IpPbx server via Windows Authentication

Connect-IpPbx


# TEST: Hardcoded username
$userName = "user name"


# Get and validate user
$userEntry = Get-IpPbxUser -UserName $userName
if (!$userEntry)
{
    Write-Error "User '$($userName)' could not be found"
    return
}


# Get and validate user data
$userData = Get-IpPbxUserData -UserEntry $userEntry
if (!$userData)
{
    Write-Error "UserData could not be received for user '$($userEntry.Name)'"
    return
}


# Update the configuration of the first shortcut key
Write-Host "Updating user '$($userEntry.Name)'..."
$userData.m_UrlKeySettings[0].Title = "Swyx Website"
$userData.m_UrlKeySettings[0].CommandLine = "http://www.swyx.com"
$userData.m_UrlKeySettings[0].CurrentDirectory = ""
 

# Save changes
Set-IpPbxUserData -UserEntry $userEntry -UserData $userData

$userEntry.Update($true)

 

Link to comment
Share on other sites


  • Most Valued User

und so für alle IpPbx Benutzer (ausgenommen buildin Benutzer wie CTI+):

 

# Connect to the local IpPbx server via Windows Authentication

Connect-IpPbx


# Go through all the user and update the first shortcut key
Get-IpPbxUser | ForEach-Object {


    # Contains the current user object
    $userEntry = $_
  
   # Get and validate user data

   $userData = Get-IpPbxUserData -UserEntry $userEntry
   if (!$userData)
   {
        Write-Error "UserData could not be received for user '$($userEntry.Name)'"
        return
    }

  
    # Update the configuration of the first shortcut key
    Write-Host "Updating user '$($userEntry.Name)'..."
    $userData.m_UrlKeySettings[0].Title = "Swyx Website"
    $userData.m_UrlKeySettings[0].CommandLine = "http://www.swyx.com"
    $userData.m_UrlKeySettings[0].CurrentDirectory = ""
  

    # Save changes
    Set-IpPbxUserData -UserEntry $userEntry -UserData $userData

    $userEntry.Update($true)

}

Link to comment
Share on other sites


Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.