Scripts

Here is a list of the scripts I have published on my blog. I'll keep the updates as I do changes based on feedback or debugging.

----------------------------------- ----------------------------------- -----------------------------------
Script name:Get-DnsAndIP.ps1
Posts:http://uc.lawedo.net/search/label/get-dnsandip
Author:Lasse Nordvik Wedø
Download link:Get-DnsAndIP.ps1 (Technet Gallery)
----------------------------------- ----------------------------------- -----------------------------------
Script name:Get-AssignedLineURI.ps1
Posts:http://uc.lawedo.net/search/label/get-assignedlineuri
Author:Lasse Nordvik Wedø
Download link:Assigned Numbers (Technet Gallery)
----------------------------------- ----------------------------------- -----------------------------------
Script name:Search-LineURI.ps1
Posts:http://uc.lawedo.net/search/label/search-lineURI
Author:Lasse Nordvik Wedø
Download link:Search-LineURI (Technet Gallery)
----------------------------------- ----------------------------------- -----------------------------------
Script name:Backup-Lync2013.ps1
Posts:http://uc.lawedo.net/search/label/Backup-Lync2013
Author:Lasse Nordvik Wedø
Download link:Backupscript-Lync_2013_v3.ps1 (Technet gallery)
----------------------------------- ----------------------------------- -----------------------------------
Script name:Get-csdocumentation.ps1
Posts:http://uc.lawedo.net/search/label/Get-csdocumentation
Author:Lasse Nordvik Wedø
Download link:Get-csdocumentation.ps1 (Technet gallery)
----------------------------------- ----------------------------------- -----------------------------------
Script name:    Get-userandpolicy.ps1
Posts:http://uc.lawedo.net/search/label/get-userandpolicy
Author:Lasse Nordvik Wedø
Download link:Get-userandpolicy.ps1 (Technet gallery)
----------------------------------- ----------------------------------- -----------------------------------
Script name:RouteExternalToAttendant.am
Link:http://uc.lawedo.net/2011/11/lync-scriptapplication-to-reroute.html 
Author:Lasse Nordvik Wedø
Download link:RouteExternalToAttendant (Technet Gallery)
----------------------------------- ----------------------------------- -----------------------------------
Script name:SendUserInfoInMail.ps1
Posts:http://uc.lawedo.net/2012/06/enabling-users-for-lync-and-making-them.html 
Author:Lasse Nordvik Wedø
Download link:SendUserInfoInMail.ps1
----------------------------------- ----------------------------------- -----------------------------------
Script name:Backupscript - Standard EDT.ps1
Posts:http://uc.lawedo.net/2012/08/backing-up-your-lync-2010-standard.html
Author:Lasse Nordvik Wedø
Download link:Backupscript - Standard EDT.ps1
----------------------------------- ----------------------------------- -----------------------------------
Script name:Backupscript - Enterprise EDT v1_2.ps1
Posts:http://uc.lawedo.net/2012/10/backup-your-lync-enterprise-2010-server.html
Author:Lasse Nordvik Wedø
Download link:Backupscript - Enterprise EDT v1_2.ps1
----------------------------------- ----------------------------------- -----------------------------------

10 comments:

  1. This is a very nice script. Thank you for writing it. Something I wanted to point out is that if you have SQL Mirroring enabled the script grabs both the Primary and Mirror server in the call:

    Get-CsService -CentralManagementdatabase | Select-Object PoolFqdn

    I'm not sure why it does this but it causes a problem for the SQL database backup part.

    I will research and provide any further feedback if I find a solution.

    Regards,
    Dino

    ReplyDelete
  2. Thank you for alerting me, I'll look into it myself. I think I have an installation I can test it on.

    ReplyDelete
  3. Thank you for alerting me, I'll look into it myself. I think I have an installation I can test it on.

    ReplyDelete
  4. Hi Lasse,
    Came across your SearchURI.ps1 script which was just the thing I was looking for. Very nice! I also wanted to use it on a Lync 2013 environment but unfortunately it didn't work. Turned out that your code only works on powershell 2 and not on 3. Also turned out that the code block for application endpoints didn't work. I've corrected both and also added direct search through parameter, powershell help and some cosmetic changes. Please let me know if and how I can send it to you.

    Regards,
    Ronald

    ReplyDelete
  5. Thanks for the heads up.
    This was written before I started treating parameters in script. It's on my to-do list. But I had not tested it on 2013 yet, and was unaware of the fault.
    You can leave a comment here, or you can reach me through Twitter or FB?
    Let me know if you're not on either, and I'll get back to you.

    Cheers!

    ReplyDelete
  6. Thanks for the great and inspiring scripts!

    Try using this code for checking the zip file process...

    [code]
    <#
    # Create the final ZIP file
    #>

    $zipFileHeader ="PK" + [char]5 + [char]6 + ("$([char]0)" * 18)
    Set-Content $ZipFileObj ($zipFileHeader)
    If ($? -eq $true) {
    Write-Host -ForegroundColor Green "Preparing zipfile: " $ZipFileObj


    $zFile = & Get-Item $ZipFileObj
    $zFile.IsReadOnly = $false

    $shellApplication = & New-Object -Com shell.application
    $zipPackage = $shellApplication.NameSpace($zFile.FullName)

    # $zipPackage.CopyHere($ZipFolder, 4)
    foreach($file in $ZipFolder)
    {
    $i = 0;
    $zipPackage.CopyHere($file.FullName)
    If ($? -eq $true) {
    Write-Host -ForegroundColor White " ** copy in progress... " $file
    }
    do
    {
    Start-sleep -milliseconds 250;
    $i++;
    # if 5sec pass and the filesize is still less than 30bytes, then note it:
    if ($i -eq 20 -and $zFile.Length -lt 30) { Write-Host -ForegroundColor Yellow " Potential problem detected..."; }
    # if 10sec pass and the filesize is still less than 30bytes, then exit:
    if ($i -gt 40 -and $zFile.Length -lt 30) { break; }
    }
    while ($zipPackage.Items().count -eq 0)
    }
    If ($zFile.Length -lt 30) {
    Write-Host -ForegroundColor Red "FAILED to compress source folder: " $ZipFolder
    # remove the file since it failed
    $zFile.Delete()
    }
    }
    Else
    {
    Write-Host -ForegroundColor Red "FAILED to create zipfile."
    }

    [/code]

    ReplyDelete
  7. Hi Lasse,
    could you please provide me a script to find all the Lync enabled users in a Pool?
    thanks in advance.
    DK

    ReplyDelete
  8. Not sure what you mean by script to find all Lync enabled users in a pool?

    A simple one-liner like:
    Get-CsUser -Filter {RegistrarPool -eq "mypool1.domain.com"} | sort-object RegistrarPool| ft -Property registrarpool,sipaddress

    Should do the trick.

    ReplyDelete

Comments on old posts will be moderated.
Comments on new posts will appear immediately..