If you read the blog before you should know that I am a big fan of automating repetitive admin tasks. Currently I am building an Ivanti Identity Director environment. Part of onboaring a new employee in this environment is enabling Skype for this new AD account.
To perform this task in Powershell I wrote the following script, which I execute in Ivanti Automation.
[sourcecode language='powershell' padlinenumbers='true'] ################################## # Enable Sykpe User ################################## # Created by R. Plomp 20-6-2019 # Version 1.0 ################################## $SAM = $[UserLogonName] $SMTP = $[Primary E-mail address] $SIP = sip:+$SMTP $Pool = $[RegistrarPool] # Import Skype for Business Module Import-Module C:\Program Files\Common Files\Skype for Business Server 2015\Modules\SkypeForBusiness\SkypeForBusiness.psd1 # Enable Skype If (Get-CsUser -Identity $SMTP -ErrorAction SilentlyContinue) { Write-Host Skype User does exists } Else { Enable-CsUser -Identity $SMTP -SipAddress $SIP -RegistrarPool $Pool Write-Host Skype User created } [/sourcecode]
When I ran this script with my standard Ivanti Admin account I received the following error:
Error: Enable-CsUser : Cannot open database “xds” requested by the login. The login failed. Login failed for user ‘…’.
The user mentioned in the error message is the Ivanti Admin that I use the execute all tasks within Ivanti Automation.
While researching this error I came to the following solution, the Ivanti Admin account should me a member of the CsAdministrator, and the RTCUniversalServerAdministrator AD Group.