PAGES

Frequently used Lync Powershell Command


Remote Powershell

$SessionOptions = New-PSSessionOption –SkipCACheck –SkipCNCheck –SkipRevocationCheck
$Session =  $Session = New-PSSession -ConnectionUri "https://LyncserverFQDN/ocspowershell" –Credential (Get-Credential) –SessionOption $SessionOptions
Import-PsSession $session


>Enabling Users for Lync based on email address

Enable-CsUser -Identity geogeorge -RegistrarPool auhlync13pool.etisalat.corp.ae -SipAddressType Emailaddress

>Fetch number of users enabled for Lync but AD account is disabled

Get-CsAdUser | ?{$_.UserAccountcontrol -match “AccountDisabled" -and $_. Enabled -eq $true} | Measure-Object

>Disabling users from Lync whose AD account is disabled. 

Get-CsAdUser | ?{$_.UserAccountcontrol -match “AccountDisabled" -and $_. Enabled -eq $true} | Disable-CsUser



Find Certificates in the wrong location to be removed or moved


Get-Childitem cert:\LocalMachine\root -Recurse | Where-Object {$_.Issuer -ne $_.Subject} | Format-List * | Out-File c:\computer_filtered.txt



No comments:

Post a Comment