Page 1 of 1

Skype for Business

Posted: Tue Jan 08, 2019 12:37 pm
by jpizzuco
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

Re: Skype for Business

Posted: Tue Jan 08, 2019 12:45 pm
by jvierra
What is the error message?

Re: Skype for Business

Posted: Tue Jan 08, 2019 12:48 pm
by jvierra
Before you pursue this farther you should read the following:

https://docs.microsoft.com/en-us/office ... powershell

Re: Skype for Business

Posted: Tue Jan 08, 2019 12:50 pm
by jpizzuco
that article is for Skype for business online , we are using on-prem

Re: Skype for Business

Posted: Tue Jan 08, 2019 1:20 pm
by jvierra
Then this is the link to start with:

https://docs.microsoft.com/en-us/skypef ... ment-tools

Re: Skype for Business

Posted: Tue Jan 08, 2019 1:22 pm
by jvierra
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