Need Help with scripting (Beginer) Level

Hello,

I Am trying to assign SIP address to the user through script and parsing thru CSV and facing the error.Can anyone please help

PART1

Import-csv C:\XX\XX.txt | ForEach-Object {

Set-CsCommonAreaPhone -Identity $_.DisplayName -SipAddress sip:$_.DisplayName@XXX.com 

}

ERROR i am getting 

Set-CsCommonAreaPhone : Incorrect domain "" specified.

PART 2

 and other case i want to know where i take 1 variable from User and take the other input from CSV explained below...I know how to take variable from USer...but not able to get that set.....

Set-CsCommonAreaPhone -Identity $_.DisplayName -SipAddress sip:(User-input-variable).$_.DisplayName@XXX.com 

so i want sipaddress to be

User-input-variable = Test

$_.DisplayName from CSV sheet lets suppose to be TONY

so my sipaddress should be set to test.tony@XXX.com

Regards

Sushant

July 11th, 2015 10:37am

You cannot use DisplayName for Identity.

Free Windows Admin Tool Kit Click here and download it now
July 11th, 2015 11:25am

Hello,

I think we can

When i just parsed Display name from csv and put SIP adress hardcoded..it worked...

July 11th, 2015 11:27am

There is no rule that says displayname is unique or that it is the same as SamAccountName.  It may work once but I snot guaranteed,

Set-CsCommonAreaPhone -Identity $_.DisplayName -SipAddress "sip:$($_.DisplayName)@XXX.com"

Free Windows Admin Tool Kit Click here and download it now
July 11th, 2015 11:34am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics