Set Skype PIN with custom script

Set Skype PIN with custom script

I have ADManager working with ServiceDesk Plus now to create the user in AD, Exchange, Skype, and O365 , but the last two things I'd like to automate are setting the Unified Messaging mailbox and PIN and the Skype PIN. I thought perhaps I could do these with custom scripts, but I'm having trouble. Right now I have a custom script that looks like this:

Set-CsClientPin -Identity %username% -Pin 4925

...and ADManager custom script in the template looks like this:

c:\windows\system32\windowspowershell\v1.0\powershell.exe -ExecutionPolicy Unrestricted "d:\manageengine\setskypepin.ps1" %username%

It seems to run, but then when I check in the Skype console it doesn't seem to have set the PIN. Skype console will at first say the user isn't "validly homed," when checking PIN status, and then eventually just say "False" for if PIN is set.

Can I get any help getting this working? 

                New to ADSelfService Plus?