[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1790
  • Last Modified:

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?
0
Anthony K O365
Asked:
Anthony K O365
  • 2
  • 2
1 Solution
 
172pilotSteveCommented:
Looks like in your header, you have a space before "Sip Address"
0
 
Anthony K O365Author Commented:
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}
0
 
Anthony K O365Author Commented:
Created a new csv. Worked fine.

thanks
0
 
172pilotSteveCommented:
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!!
0

Featured Post

Easily manage email signatures in Office 365

Managing email signatures in Office 365 can be a challenging task if you don't have the right tool. CodeTwo Email Signatures for Office 365 will help you implement a unified email signature look, no matter what email client is used by users. Test it for free!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now