How do I enforce "Show My Picture" instead of "Hide My Picture" in Lync Server 2013?

I was scouring TechNet and the web for a script that could perform the same task as one that I previously used for Lync 2010.
In Lync 2010, we had already used Lync policy to enforce that only the Active Directory photo could be used. One thing that we couldn't set via policy however was the ability to complete remove the "Hide My Picture" option in Lync 2010 client.
This left users with the ability to freely switch between showing the Corporate photo or no photo. I did eventually find and make use of script that constantly checked for this setting switch, then switched all users back to the desired "Show My Picture"
setting. I don't recall who wrote it, but it's easy to find on technet. As we started to move more and more users to our Lync 2013 enterprise pool, I noted that even though the script was running, the setting seemed to be changeable. A closer look revealed
that the script didn't function correctly against SQL for our 2013 pool.
I took the concept and applied it to Lync Server 2013 after studying the differences in Userdata. In Lync 2013, because UserData is in .zip, you need to convert it to 2010 format XML to use logic intended for Lync 2010. My script will extract 2013 data,
convert it to 2010, query for users who are set to "Hide My Picture" and then export any guilty users to an edited2010 XML. The script then converts this to 2013 Format .zip, and uploads the data for these users only. I chose to use Update-CSUserData
insted of Import-CSUserData as this avoids having to restart my Front End. I then use a scheduled task on my Front End server which runs this script every hour.
Please note: You can use this script, but I guarantee nothing about it's functionality, and I am not responsible for how you positively/negatively use it. You should always test things in a Lab Environment. Furthermore, this script was run on a relatively
smaller Enterprise system in which we are by default set to "Show My Picture" and already assigned as part of our user policy the ForceADPhoto attribute. This means that running the script is less intensive on my FE than say on a FE with 10,000 users
where none of the users were set to "Show My Picture". Please keep this in mind when planning to execute against your FE. You may want to edit my script and insert the -UserFilter or -WhatIf in the Export-CsUserData UpDate-CsUserData.
Anyways, I hope this solves the similar issue for many of you Lync 2013 administrators. Please feel free to share my work with others if it does, and also give this post some good feedback and/or mark my post as the answer to your problem.
Alas, here's the script (save it as a .ps1 , i.e. ForceShowMyPicture.ps1)
#Lync 2013 ForceShowMyPicture - Compiled by Octavio A. Serpa (Octavio-Admin on TechNet)
# Import Lync Module
Import-Module “C:\Program Files\Common Files\Microsoft Lync Server 2013\Modules\Lync\Lync.psd1"
###Variables To Set
#This variable is a folder where files will be temporarily written
$folderPath = “C:\Lync2013Scripts\Export”
#This is the FQDN of the pool in which the users you want to target reside
$poolFQDN = “<lyncpool.domain.local>”
###Done
#Message Out
Write-Host -ForegroundColor YELLOW “CHECKING THAT TEMP EXPORT FOLDER PATH EXISTS"
If (-not (Test-Path "$folderPath" -pathType container))
 "ERROR: Your Export Directory doesn't exist!"
 Exit
Write-Host -ForegroundColor Green “TEMP EXPORT FOLDER DOES EXIST"
Write-Host -ForegroundColor YELLOW “PRE-CLEANING OLD EXPORT/IMPORT FILES"
If (Test-Path "$folderPath\Lync2013UserData.zip") { Remove-Item "$folderPath\Lync2013UserData.zip" }
If (Test-Path "$folderPath\Lync2010UserData.xml") { Remove-Item "$folderPath\Lync2010UserData.xml" }
If (Test-Path "$folderPath\Lync2010EditedUserData.xml") { Remove-Item "$folderPath\Lync2010EditedUserData.xml" }
If (Test-Path "$folderPath\Lync2013EditedUserData.zip") { Remove-Item "$folderPath\Lync2013EditedUserData.zip" }
Write-Host -ForegroundColor Green “PRE-CLEANING COMPLETED SUCCESSFULLY"
#Message Out
Write-Host -ForegroundColor YELLOW “EXPORTING LYNC 2013 POOL USER DATA”
Export-CsUserData -PoolFqdn $poolFQDN -FileName $folderPath\Lync2013UserData.zip
Write-Host -ForegroundColor Green “EXPORT COMPLETED SUCCESSFULLY"
#Message Out
Write-Host -ForegroundColor YELLOW “CONVERTING LYNC 2013 USER DATA TO 2010 FORMAT”
Convert-CsUserData -InputFile "$folderPath\Lync2013UserData.Zip" -OutputFile "$folderPath\Lync2010UserData.xml" -TargetVersion Lync2010
Write-Host -ForegroundColor Green “CONVERSION COMPLETED SUCCESSFULLY"
#Message Out
Write-Host -ForegroundColor YELLOW “CHECKING THAT FORMAT CONVERSION WAS SUCCESSFUL AND .XML EXISTS”
If (-not (Test-Path "$folderPath\Lync2010UserData.xml" -pathType leaf))
 "ERROR: Verify that $folderPath is writable!"
 Exit
Write-Host -ForegroundColor Green “CONVERSION COMPLETED SUCCESSFULLY"
#Message Out
Write-Host -ForegroundColor YELLOW “LOADING XML”
$d = [xml] (Get-Content "$folderPath\Lync2010UserData.xml")
Write-Host -ForegroundColor Green “XML LOADING COMPLETED SUCCESSFULLY"
#Message Out
Write-Host -ForegroundColor YELLOW “CORRECTING AD PHOTO SETTING”
$changes = 0
$lastProcessedUser = $null
foreach ($hr in $d.HomedResources.HomedResource)
 $found = 0
 foreach ($c in $hr.Containers.Container)
  foreach ($p in $c.Publication)
   If ($p.CategoryName -eq 'contactCard' -and $p.InstanceNum -eq 6 -and $p.Data.contactCard.displayADPhoto -eq 'false')
    If ($hr.UserAtHost -ne $lastProcessedUser)
     "$($hr.UserAtHost) reset"
     $lastProcessedUser = $hr.UserAtHost
    $p.Data.contactCard.displayADPhoto = 'true'
    $p.Version = (([int] $p.Version) + 1).ToString()
    $p.PrevPubTime = $p.LastPubTime
    $p.LastPubTime = (Get-Date -Format s).ToString()
    $found = 1
    $changes++
 If ($found -eq 0) { [Void]$d.HomedResources.RemoveChild($hr) }
Write-Host -ForegroundColor Green “AD PHOTO SETTING CORRECTIONS COMPLETED SUCCESSFULLY"
#Message Out
Write-Host -ForegroundColor YELLOW “Changes: $changes"
If ($changes -ne 0)
 #Message Out
 Write-Host -ForegroundColor YELLOW “RE-SAVING XML”
 $d.Save("$folderPath\Lync2010EditedUserData.xml")
#Message Out
Write-Host -ForegroundColor YELLOW “CONVERTING LYNC 2010 .XML BACK TO 2013 .ZIP FORMAT"
Convert-CsUserData -InputFile "$folderPath\Lync2010EditedUserData.xml" -OutputFile "$folderPath\Lync2013EditedUserData.zip" -TargetVersion Current
#Message Out
Write-Host -ForegroundColor Green “CONVERSION BACK TO 2013 .ZIP FORMAT SUCCESSFUL"
#Message Out
Write-Host -ForegroundColor YELLOW “IMPORTING LYNC 2013 POOL DATA FOR CORRECTED USERS”
Update-CsUserData -FileName $folderPath\Lync2013EditedUserData.zip -Confirm:$false -Verbose
Write-Host -ForegroundColor Green “IMPORT COMPLETED SUCCESSFULLY"
Write-Host -ForegroundColor YELLOW “STARTING POST-IMPORT-CLEANUP OF EXPORT/IMPORT FILES"
If (Test-Path "$folderPath\Lync2013UserData.zip") { Remove-Item "$folderPath\Lync2013UserData.zip" }
If (Test-Path "$folderPath\Lync2010UserData.xml") { Remove-Item "$folderPath\Lync2010UserData.xml" }
If (Test-Path "$folderPath\Lync2010EditedUserData.xml") { Remove-Item "$folderPath\Lync2010EditedUserData.xml" }
If (Test-Path "$folderPath\Lync2013EditedUserData.zip") { Remove-Item "$folderPath\Lync2013EditedUserData.zip" }
Write-Host -ForegroundColor Green “POST-IMPORT-CLEANUP COMPLETED"
#Message Out
Write-Host -ForegroundColor Green “AD PHOTO SETTING SUCCESSFULLY UPDATED"

When I try to run this I get the follow error.  Any thoughts?
Update-CsUserData : Unable to cast COM object of type 'System.__ComObject' to interface type
'Microsoft.Rtc.Interop.User.ICsUserManagement'. This operation failed because the QueryInterface call on
the COM component for the interface with IID '{D5ADD966-BDC3-4A8F-BFE8-6A59A9F74CB2}' failed due to the
following error: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
At C:\Lync2013Scripts\ForceDisplayPhoto.ps1:113 char:1
+ Update-CsUserData -FileName $folderPath\Lync2013EditedUserData.zip -Confirm:$fal ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: ([email protected]:String) [Update-CsUserData], Invalid
   CastException
    + FullyQualifiedErrorId : Microsoft.Rtc.Management.AD.Cmdlets.ImportOcsUserDataCmdlet

Similar Messages

  • How to reinstall Lync server 2013 Core Component Server Applications

    Hi Would like to know how to register back the core server applications and where can i find the priority list. I incidentally
    removed the server applications (ClientVersionFilter, IIMFilter, VoIP Apps and EumRouting and Outbouding) when i removed my MSPL script application from the pool. I missed out to put my script
    app name after pool name when i run the command remove-cstrustedapplication. Then, it removed all the core apps from that pool.
    I found that .am files and .exe files are still in the C:\Program Files\Microsoft Lync Server 2013\Core and tried
    to register back using cmdlets but not very sure about the priority of the apps. Or can I install RTCHost.exe? Now Outgoing call is not working. Please kindly help. Thanks in Advance.

    Oh.. thank you very much both
    Saleesh and Eric. I will try it. 
    What I did is that I used the cmdlets New-CsServerApplication and registered the server apps (checked the server apps
    list from testing fe server) like how I register MSPL script app. But I may miss out some components since testing fe server uses Standard Edition. I registered my
    MSPL script app back too, but after a while Lync Front End Service keeps on stopping.  I am not sure that
    MSPL script or missing components which one causes to stop front end service. Now I am checking the event viewer logs.
    If I run add-remove Lync component wizard on the server, will it remove any other settings like removing users from
    pool? or it just install/unstall lync server core components only?
    Many thanks!

  • How to run a Lync Server 2013 in amazon ec2 Instance ?

    Hi Friends,
    I would like to install a Lync server 2013 in amazon ec2 instance. Let me know can i install Active Directory server, Lync Server 2013 and Media server in a single amazon instance ?. If it possible how can i do it ?. And is any other features need to install
    to get the fully functional Lync server. Please help me am newbie in Lync environment  

    You can get Lync working in EC2 and I have lab'd his many times. Having said that the process isn't that straight forward (especially if you plan to do voice) a lot of planning and testing, specifically of the network would need to be undertaken.
    You can add multiple interfaces to an EC2 instance (see here http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html)
    If you're hard set on using EC2 you can get it to work, but I personally would look at Office 365 E4 or a small on-premise deployment depending on your requirements. 
    If this helped you please click "Vote As Helpful" if it answered your question please click "Mark As Answer"
    Georg Thomas | Lync MVP
    Blog www.lynced.com.au | Twitter
    @georgathomas
    Lync Edge Port Check (Beta)
    This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • How to achieve Multi-Tenant in Lync Server 2013 Enterprise Edition

    Hi,
      As LHPv2 is discontinued, is anyone has idea how to achieve Multi-Tenant in Lync Server 2013 Enterprise Edition?
    e.g users from different tenants should not be able to communicate unless it is allowed either by federation or any other form.
    J.B.Patnaik

    once a Topology has been published you can not change the FQDN.
    Also you can refer shah-Khan answer, it will be helpful for you
    http://social.technet.microsoft.com/Forums/lync/en-US/47d4e101-4f7b-4115-8f44-897eb5410acb/need-to-change-a-published-fqdn-lync-pool-for-lync-enterprise-2010?forum=ocsplanningdeployment
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer"
    Mai Ali | My blog: Technical | Twitter:
    Mai Ali

  • How uninstall a Lync Server 2013 deployment?

    Hi,
    I have one question... how uninstall a Lync Server 2013 deployment?
    Thks!!!

    To uninstall Lync 2013, You can check below link
    http://www.logicspot.net/index.php?id=51
    For uninstall Lync Enterprise, you can refer below link {it's same for Lync 2013}
    http://terenceluk.blogspot.com/2011/01/step-by-step-instructions-for.html
    After uninstall Lync roles and components, you will need to
    remove it from Active Directory
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer"
    Mai Ali | My blog: Technical | Twitter:
    Mai Ali

  • How do I create a project site after I publish a project in Project Server 2013?

    How do I create a project site after I publish a project from project pro 2013 in Project Server 2013? I'm trying to look for an option in the ribbon but haven't found any. 
    Thanks
    James T.F

    Hi James,
    See in the article the procedure for site provisionning settings.
    Note that the project site is created based on the template associated to the chosen project type (EPT) when the user first publishes his project. Be aware that if you allow the user to choose weither or not he'll create a sharepoint site when publishing
    his project, he will be prompted in Project Pro with a dialog box giving the choice to create or not the site.
    Hope this helps,
    Guillaume Rouyre, MBA, MCP, MCTS |

  • How to put Mediation Server on Maintenance Mode for LYNC server 2013

    how to put the LYNC 2013 Mediation server on Maintenance mode???

    Hi,
    Did you solve the issue with the help the people above provided?
    If you mean server draining feature you can also check Topology option on Lync Server Control Panel, on Topology interface, click “Action” and there is an action called “Prevent new sessions for service”.
    Here is a similar case may help you:
    http://social.technet.microsoft.com/Forums/lync/en-US/ef3515a9-54c0-4b7a-ab48-45196764d837/how-to-use-lync-server-draining-feature?forum=ocsplanningdeployment
    Best Regards,
    Eason Huang
    Eason Huang
    TechNet Community Support

  • How to get the incoming filename and store it to sql table using biztalk server 2013

    HI,
    1)I need to get the incoming EDI filename which is received and save the filename in to the database.
    2)How can i get the EDI Duplicate filename if i set the do not allow duplicate under validation tab in X12 agreement settings in biztalk admin console. In this case since the duplicate file will not come in to orchestration. In this case how
    can i acheive this.
    Thanks,
    Vijayan
    vijayan

    For both cases, the filename can be found on the FILE.ReceivedFileName Context Property.  You can access this Property in a Pipeline Component or Orchestration and take any action you want, such as apply to a database.
    The value is accessed by: MyReceivedMessage(FILE.ReceivedFileName)
    In the case of a duplicate EDI Interchange, you would use the Failed Message Routing feature to capture the error message with either an Orchestration or Send Port.

  • How to unattended deploy Lync Server 2013 administrative tools

    Hi all,
    I'm trying to deploy the Lync Server 2013 administrative tools unattended but it seams not to be such easy as with other Microsoft products.
    I have looked for Lync Server setup command options/Switches but didn't find anything.
    Currently the only way it really works is by manually installing the administrative tools using normal deployment wizard.
    I have obsorved that the wizard then executes in the backgroud (not transparent) a set of different tasks like preparation tasks, installs some MSIs from the setup folder (like SharedManagementObjects.msi, SQLSysClrTypes.msi) and it copies
    the Lync Powershell Module locally.
    I'm trying to find a way where I can deploy only this Lync 2013 administrative Tools on a set of Administrators Workstation (Windows 7 clients) and on some Windows Server 2012 R2 Management Servers by using for example a Powershell script or any other way
    ... important is that I can install them unattended and distribute them via existing software distribution tool.
    Is there really no way to install them unattended?

    Hi Sergio Verardo,
    If I understand you correctly, the following steps for your reference.
    1. Installing all the required software that Anthony mentioned.
    2. Running the following command on target machine.
    Msiexec
     /i \\SharePath\admintools.msi /qn
    I tested it and worked on my computer.
    Best regards,
    Eric

  • How can I connect the phone network to LYNC Server 2013?

    Greetings,
    We have a working implementation of Lync Server 2013 (pc to pc), our objective is to connect lync to our phone central, receive and send calls from lync clients (pc, phone, etc), basically enterprise voice services.
    I would like to know the following:
    Hardware that I need for this beside the server.
    Extra configurations that must be done.
    If you could recommend me the hardware needed it would be helpful.

    You'll need a gateway typically. You can find a list of qualified IP gateways here: http://technet.microsoft.com/en-us/office/dn788945.aspx
    I typically lean towards the AudioCodes Mediant line, though many here love Sonus as well.  You'll need to pick a method to connect to your PBX before you begin, such as via a T1/E1 trunk, FXO ports, or a SIP trunk depending on what your PBX will
    support. 
    You'll need to configure the PBX to route calls through the T1 towards Lync and vice versa.  You'll also need to configure the gateway itself, so I'd go with a consultancy with experience here or purchase remote implementation support from the hardware
    manufacturer.
    On the Lync side, you'll need to configure dial plans, voice policies, usages, and routes:
    http://technet.microsoft.com/en-us/library/gg398272.aspx
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question please click "Mark As Answer".
    SWC Unified Communications
    This forum post is based upon my personal experience and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • How to get cisco show and share

    Hi,
        I have a DMM with version 5.2 and saw that on my licesing I have show and share. But how do I install show and share? Can I install it on DMM server?Do I need to install it in another server? Where can I download it? I think the show and share installation is called SS-5.2.0.20.iso, but I do not found it on cisco support download section.  

    Mario,
    Show and Share(SnS) is an Appliance just like your Digital Media Manager (DMM).
    You have to purchase the Appliance from Cisco or a Cisco Partner.  Then you have
    to purchase use licenses for Authors etc...   The Appliance software is not separate
    from the hardware and is not downloadable.
    Please contact your Cisco Sales Rep or Account for further explanation and they
    can assist you with your companies needs.
    Thanks!
    T.

  • How to Check if you are running Lync Server Evaluation or Licensed Version

    I was not sure if our Lync environment was running Evaluation Version of the Lync Front End server or the Volume Licensed Version. I was looking to migrate from PoC to production so I had to make sure that the services didn’t stop in the middle of production.
    A simple cmdlet to verify this: Get-CsServerVersion
    1. When run it will attempt to
    2. Read the registry value HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Real-Time Communications\{A593FD00-64F1-4288-A6F4-E699ED9DCA35}\Type
    3. Based on that registry value, the cmdlet will then report back the version number of the software and the Lync Server licensing information the local computer and report back one of the following:
    o That the Lync Server volume license key has been installed on the computer, meaning that no updating is necessary.
    o That the Lync Server evaluation license key has been installed, meaning that the computer must be updated.
    o That no volume license key is required on the computer. Updating from the evaluation version to the licensed version is only required on Front End Servers, Directors, and Edge Servers.
    What if Evaluation Version is installed and you have to upgrade to Licensed Version?
    1. Log on to the computer as a local administrator
    2. Click Start, click All Programs, click Microsoft Lync Server 2013, and then click Lync Server Management Shell.
    3. In the Lync Server Management Shell, type the following command and then press ENTER:
    o msiexec.exe /fvomus server.msi EVALTOFULL=1 /qb
    o Note that you might need to specify the full path to the file server.msi. This file can be found in the Setup folder of the Lync Server Volume media installation files.
    4. After Setup finishes running, type the following from the command prompt and then press ENTER:
    o Enable-CsComputer
    o Repeat this procedure on any other Front End Server, Director, or Edge Server running an evaluation copy of Lync Server
    o This procedure should also be performed on any Branch Office Servers that were deployed by using the Lync Server media installation files
    Using Get-CsServerVersion will also show you
    1. What Version Number you are running
    2. What patches has been installed

    Hi,
    I couldn't find direct way of saying whether node manager is running or not but here is the work around. Using WLST when you say "startNodeManager", if the node manager is running this command throw an output saying "node manager is already running". Let me know if this solution works for you, if it works then I can give you java program for this if required or you can use "WLST JAVA Mode".
    Thanks.
    Vijay Bheemineni.

  • How to disable SSLv3 and RC4 on Lync Server Access Edge?

    We use Lync Server 2013.
    How to disable SSLv3 and RC4 on Lync Server Access Edge?
    This solution https://technet.microsoft.com/en-us/library/security/3009008.aspx doesn't work

    Hi dizen,
    To completely disable RC4, you can create the following registry key:
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC4 128/128]
    "Enabled"=dword:00000000
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC4 40/128]
    "Enabled"=dword:00000000
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC4 56/128]
    "Enabled"=dword:00000000
    For more details, please check out this KB.
    http://support.microsoft.com/kb/2868725
    Best regards,
    Eric

  • How Can I move contact users saved on lync client 2010 to lync client 2013 ?

    i did a migration between lync 2013 and lync 2010 everything done ok 
    now when move the users from the lync 2010 pool to new pool  and sign in  with my user i couldn't  see any contact on my old list 
    there was DBIMPEXP.exe tool but this tool not exist in lync 2013
    i took a backup for all users but how can i restored them to new client
    the backup file on lync 2010 is "xml"
    and in the lync 2013 is "zip"
     thank you all

    Please check the following blog.
    http://www.shudnow.net/2012/10/09/dbimpexp-exe-functionality-integrated-into-lync-2013-preview-management-shell/
    Lync Server 2013 Preview has deprecated the use of DBIMPEXP.exe. 
    There are now native Lync Mangement Server cmdlets to provide the equivalent.
    You can use the command convert-csuserdata to convert between a 2010 XML file provided from DBIMPEXP.exe and a ZIP file provided from Export-CSUserData.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Apps show a white square instead of the app picture?

    My ipod touch shows some apps as a white square instead of the app picture.  The app still works but I don't
    know why it is diplaying this way.

    Where is your Calculator application located? Before you can put it into the Dock you need to remove the Question Mark. Select it with the mouse and drag it out of the until it "poofs" away. Now locate Calculator and drag its icon into the Dock.

Maybe you are looking for

  • I need to download adobe x standard

    I had to remove adobe x standard that i had purchased.  I can't find the link for this program.  Where can i find a link? thanks.

  • Can't connect my Ps3 to Home Hub

    Hi, just got a home hub yesterday and all the computers in the house are working fine. But when I went to connect my PS3 it wasn't having any of it. I fllowed the instructions step-by-step and tried it multiple times yet still have nothing. The probl

  • Permission to screencast

    Hello, a few days ago I've started a YouTube channel in which I posted 2-3 video tutorials on how to make and slice layers in Photoshop CS5 in order to create a website. There is also an additional video in which I explain how to create glossy web 2.

  • Request Status stays yellow after successful load

    We recently started loading two infocubes from the same data source.  - The Monitor shows that the load completed normally with no errors.  - Manage on the first cube shows that the status is green and the data available for reporting.  - Manage on t

  • How to stop firefox from switching to new tab?

    The issue I am dealing with is that I want Firefox to open all links in a new tab but not to switch to them automatically. I have checked all the settings in the Tools >> Options >> Tab menu and I have them all checked except for the last two. I am o