Hi Guys,
I'm using PS S2019
I'm trying to connect to our skype for business server 2015 to delete a user account but every time I try it doesn't seem to work, this is my script below
$button1_Click = {
$cred = Get-Credential DOMAIN\UserAccount that has rights
$session1 = New-PSSession -ConnectionURI "https://skype Server/OcsPowershell" -credential $cred
import-PSSession $session1 -AllowClobber
sleep 10
$richtextbox1.AppendText("Connecting to skype, wait 10secs`n")
$EnterUser = Read-Host "Enter Username"
$richtextbox1.AppendText("$EnterUser`n")
$progressbar1.Value = 10
$SamAccountName = (get-csaduser $EnterUser | select SamAccountName | ft -hidetableheaders | Out-String).trim()
$richtextbox1.AppendText("$SamAccountName`n")
Disable-CsUser -identity "$SamAccountName"
Remove-PSSession $session1
Skype for Business
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Skype for Business
Before you pursue this farther you should read the following:
https://docs.microsoft.com/en-us/office ... powershell
https://docs.microsoft.com/en-us/office ... powershell
Re: Skype for Business
Here is a detailed doc on how to set up connections and how to connect with PowerShell.
https://docops.ca.com/ca-identity-manag ... erver-lync
https://docops.ca.com/ca-identity-manag ... erver-lync