Avatar of Anthony K O365
Anthony K O365
Flag for United States of America asked on

Error message when Using Lync 2010 Powershell command

Enable-CsUser : ConstraintViolationNoLeadingOrTrailingWhitespace
At C:\EnableLync.ps1:3 char:15

Here is what I'm using:

Name,Pool, SipAddress
joeSmith,lyncPool.contoso.com,sip:joeSmith@contoso.com


Here is the script

$users = import-csv C:\lync_Users.csv
foreach ($user in $users)
{Enable-CsUser –Identity $user.name –RegistrarPool $user.pool –SipAddress $user.sipaddress}


Any thougts?
Chat / IMExchangeConferencing Software

Avatar of undefined
Last Comment
172pilotSteve

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
172pilotSteve

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Anthony K O365

ASKER
No spaces anywhere

Name,Pool,SipAddress

Note the error lin below:

Enable-CsUser : ConstraintViolationNoLeadingOrTrailingWhitespace
At C:\EnableLync.ps1:3 char:15

Would this be in the script? Here is the script:

$users = import-csv C:\lync_Users.csv
foreach ($user in $users)
{Enable-CsUser –Identity $user.name –RegistrarPool $user.pool –SipAddress $user.sipaddress}
Anthony K O365

ASKER
Created a new csv. Worked fine.

thanks
172pilotSteve

Just to make sure..  Look at your two lines..  Copied from your 2 posts:
Name,Pool, SipAddress
Name,Pool,SipAddress

See the difference?  That's the space I was referring to, and I think that's why it didn't work earlier for you..  No matter, thanks for the points, and good luck w/ Powershell - It really is an AWESOME tool!!
Your help has saved me hundreds of hours of internet surfing.
fblack61