Author: Edwin Joseph
Publication date: September 24, 2013
Product version: Lync Server 2013
Introduction
When a Lync 2013 desktop client for Windows signs-in, to minimize the bandwidth consumption the Lync client retrieves a lot of information from cache. This cached information is stored in the users Sip profile in a folder named Sip_(SipURI of the user) located on a Windows computer in the following folder:
%UserProfile%AppDataLocalMicrosoftOffice15.0Lync
If there is any issue with the files in the sip profile user might experience issue with Lync client such as:
To resolve the above issue exist of out of the Lync client delete the content of the sip profile folder or delete the sip profile folder itself. However, this is not a scalable solution for large organizations. To solve this problem, I have written a script that deletes the SIP profile folder on the user’s computer which in turn deletes the cache files used by Lync 2013
Note: When restarting the Lync after deleting the SIP profile folder, the client will attempt to download the address book file resulting in heavy bandwidth consumption. This script will delete all the sip profile folders under %UserProfile%.
The Script
'==========================================================================
'
‘NAME: Delete sip profile
'
‘BY Edwin Joseph
'
‘COMMENT: This script deletes the sip profile for the user from machine if it exists
‘the purpose here is delete the cache files used by Lync 2013 client
'==========================================================================
Option Explicit
Dim objShell12
Dim objUserEnv
Dim strUserPro
Dim userProfile,SipProfile
Dim proPath
Dim objFSO
Dim objStartFolder
Dim objFolder
Dim colFiles
Dim objFile
Dim Subfolder
Dim uProfile
Set objShell12=CreateObject("WScript.Shell")
Set objUserEnv=objShell12.Environment("User")
strUserPro= objShell12.ExpandEnvironmentStrings(objUserEnv("TEMP"))
userProfile = objShell12.ExpandEnvironmentStrings("%userprofile%")
DeleteSip strUserPro 'delete user sip profile
'Delete sip Profile
SipProfile=userProfile & "AppDataLocalMicrosoftOffice15.0Lync"
uProfile=userProfile & "AppDataLocalMicrosoftOffice15.0"
Set objFSO = CreateObject("Scripting.FileSystemObject")
objStartFolder = uProfile
Set objFolder = objFSO.GetFolder(objStartFolder)
'Wscript.Echo objFolder.Path
ShowSubfolders objFSO.GetFolder(objStartFolder)
Sub ShowSubFolders(Folder)
For Each Subfolder in Folder.SubFolders
proPath = Right(Subfolder.Path,4)
'Wscript.Echo proPath
If proPath = "Lync" Then
DeleteSip SipProfile
End if
Next
End Sub
DeleteSip SipProfile
'this is also to delete user sip profile
SipProfile=SipProfile & "Sip_*"
DeleteSip SipProfile
WScript.Quit
Sub DeleteSip (strSipPath)
On Error Resume Next
Dim objFSO
Dim objFolder,objDir
Dim i
Set objFSO=CreateObject("Scripting.FileSystemObject")
Set objFolder=objFSO.GetFolder(strSipPath)
'delete folder
For i=0 To 10
For Each objDir In objFolder.SubFolders
objDir.Delete True
Next
Next
'clear all objects
Set objFSO=Nothing
Set objFolder=Nothing
Set objDir=Nothing
End Sub
'==================================================================
How to Use the Script
To use the script, do the following:
This VBS file can be executed in multiple ways.
This method requires end user assistance and awareness. This is, however, the fastest way to achieve the end result.
To use the group policy method, deploy the VBS file as a logon policy. All end users need to do is log off, then log on to their Windows workstation.
To suppress the Open File - Security Warning
Note: Do not forget to unlink the policy after confirming that all users have logged out and logged in.
Summary
In this article we have examined how to delete Sip profiles on from multiple workstations using a script which in turn will delete cache files used by the Lync client. This script has been tested for both Windows 7 and above client operating systems as per System requirement for Office 2013 .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.