Lync Powershell Scripts for Bulk Import / Edit

I have created some small scripts for bulk enable / import Lync users and a script for changing for example disable audio / video. I’m not a powershell script Guru, yet but maybe these scripts can help you out! The scripts are using a CSV file for import / edit these users.

Bulk import.ps1

param( [string] $importfile = $(Read-Host -prompt `
    “Please enter a file name”))
$importedusers = Import-Csv $importfile
 
$transcriptname = “MoveorEnableUsers” + `
    (Get-Date -format s).Replace(“:”,”-“) +”.txt”
Start-Transcript $transcriptname
 
foreach ($importeduser in $importedusers)
    {
        if ($importeduser.MoveorEnable -eq “Move”)
            {
                Move-CsUser $importeduser.SipUri -target `
                   $importeduser.Target -verbose
            }
        else
    {
  Enable-CsUser $importeduser.UPN -SipAddress `
              $importeduser.SipUri -RegistrarPool `
              $importeduser.Target -Verbose
    }
 
 
    }
Stop-Transcript

Bulk Edit

param( [string] $importfile = $(Read-Host -prompt `
    “Please enter a file name”))
$importedusers = Import-Csv $importfile
 
$transcriptname = “BulkEdit” + `
    (Get-Date -format s).Replace(“:”,”-“) +”.txt”
Start-Transcript $transcriptname
 
foreach ($importeduser in $importedusers)
     {
  Set-CsUser $importeduser.UPN -AudioVideoDisabled $True `
              -Verbose
    }
Stop-Transcript

Example CSV file:

SipUri,MoveorEnable,Target,UPN
sip:[SIPURI],Enable,”[FQDN LYNC POOL]”,[UPN]

Over salpoels
Consultant Unified Communications

2 Responses to Lync Powershell Scripts for Bulk Import / Edit

  1. Pingback: Enabeling users for Lync - Communified.net Blog

    • salpoels says:

      see the last lines of the script:

      foreach ($importeduser in $importedusers)
      {
      Set-CsUser $importeduser.UPN -AudioVideoDisabled $True `
      -Verbose
      }
      Stop-Transcript

Geef een reactie

Vul je gegevens in of klik op een icoon om in te loggen.

WordPress.com logo

Je reageert onder je WordPress.com account. Log uit /  Bijwerken )

Google photo

Je reageert onder je Google account. Log uit /  Bijwerken )

Twitter-afbeelding

Je reageert onder je Twitter account. Log uit /  Bijwerken )

Facebook foto

Je reageert onder je Facebook account. Log uit /  Bijwerken )

Verbinden met %s

%d bloggers liken dit: