ZimmiTheSwissGuy Posted September 30, 2020 #1 Share Posted September 30, 2020 Hello Guys I'm trying to change the ProfilePicture of each User in the Swyx-Software. The WhatIf tells me he did it, but nothing changes.... I have 3 Pictures for each location where the employer could work. I have a parameter in the CSV, so i can sort them. Can anybody help me ? Here my Code Import-Module IpPbx Connect-IpPbx -ServerName voip01 $Path = 'C:\_SETUP\SPEEDDIAL\SpeedDial_20200929.txt' $Members = Get-IpPbxGroupMember -GroupName "Jeder" $Keys = Import-Csv -Path $Path -Delimiter ";" -Header 'Name','Nummer', double.Idx,'Standort' -Encoding UTF8 $ARL = Import-Csv -Path $Path -Delimiter ";" -Header 'Name','Nummer', double.Idx,'Standort' -Encoding UTF8 | ? standort -like 'ARL' $SIS = Import-Csv -Path $Path -Delimiter ";" -Header 'Name','Nummer', double.Idx,'Standort' -Encoding UTF8 | ? standort -like 'SIS' $ZWI = Import-Csv -Path $Path -Delimiter ";" -Header 'Name','Nummer', double.Idx,'Standort' -Encoding UTF8 | ? standort -like 'Zwi' Foreach ($Member in $Members) { Foreach ($Key in $Keys) { $NameKey = New-IpPbxSpeedDialKey -ClearBeforeDialing -DialImmediately:$false -Number $key.Nummer -Label $key.Name -WhatIf Add-IpPbxSpeedDialKey -SpeedDialKey $NameKey -UserName $Member.Name -SpeedDialKeyId $Key.Idx -WhatIf } } Foreach($ARLPicture in $ARL){ Set-IpPbxUserPicture -UserName $ARLPicture.Name -Path C:\_Scripts\Pictures\Benutzerbild-A.png -Overwrite -WhatIf } Foreach($SISPicture in $SIS){ Set-IpPbxUserPicture -UserName $SISPicture.Name -Path C:\_Scripts\Pictures\Benutzerbild-S.png -Overwrite -WhatIf } Foreach($ZWIPicture in $ZWI){ Set-IpPbxUserPicture -UserName $ZWIPicture.Name -Path C:\_Scripts\Pictures\Benutzerbild-Z.png -Overwrite -WhatIf } Link to comment Share on other sites More sharing options...
ZimmiTheSwissGuy Posted October 1, 2020 Author #2 Share Posted October 1, 2020 Now i could fix it. I needed to get the user first, like this: Get-IpPbxUser -UserName $ARLPicture.RealName | Set-IpPbxUserPicture -Path C:\_Scripts\Pictures\Benutzerbild-A.png -Overwrite Now it works.. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now