SOLVED

Teams user info automation

%3CLINGO-SUB%20id%3D%22lingo-sub-568544%22%20slang%3D%22en-US%22%3ETeams%20user%20info%20automation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-568544%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20hoping%20someone%20can%20provide%20me%20with%20some%20info.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20to%20be%20able%20to%20run%20a%20script%20that%20allows%20me%20to%20assign%20the%20following%20to%20multiple%20users%20replacing%20each%20user%20identity%20and%20tel%20number%20with%20what%20ever%20is%20assigned%20in%20one%20go.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESet-CsUser%20-Identity%20User%40*****.co.uk%20-EnterpriseVoiceEnabled%20%24true%20-OnPremLineURI%20tel%3A********%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20assuming%20i%20will%20need%20a%20.csv%20file%20but%20how%20would%20I%20then%20set%20out%20the%20csv%20to%20input%20the%20correct%20data%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENoob%20question...%20sorry...%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-568544%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-570133%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20user%20info%20automation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-570133%22%20slang%3D%22en-US%22%3E%3CP%3EAssuming%20you%20have%20a%20blabla.csv%20with%20the%20Identity%20column%20designating%20the%20user%20and%20the%20Telephone%20column%20designating%20the%20number%2C%20this%20should%20do%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3EImport-CSV%20blabla.csv%20%7C%20%25%20%7B%20Set-CsUser%20-Identity%20%24_.Identity%20-EnterpriseVoiceEnabled%20%24true%20-OnPremLineURI%20%24_.Telephone%20%7D%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Contributor

I am hoping someone can provide me with some info.

 

I want to be able to run a script that allows me to assign the following to multiple users replacing each user identity and tel number with what ever is assigned in one go.

 

Set-CsUser -Identity User@*****.co.uk -EnterpriseVoiceEnabled $true -OnPremLineURI tel:********

 

I am assuming i will need a .csv file but how would I then set out the csv to input the correct data?

 

Noob question... sorry... :)

 

 

 

 

 

 

 

 

1 Reply
Best Response confirmed by WelshViking (Contributor)
Solution

Assuming you have a blabla.csv with the Identity column designating the user and the Telephone column designating the number, this should do:

 

Import-CSV blabla.csv | % { Set-CsUser -Identity $_.Identity -EnterpriseVoiceEnabled $true -OnPremLineURI $_.Telephone }