Batch rename of users SIP account login name

Half of my lync users are [email protected] and half are [email protected], can anyone show me a cmdlet to modify the users name format in bulk? set-csaduser?
***Don't forget to mark helpful or answer***

Ok, try this:
$x = Get-ADUser -LDAPFilter "(&(objectCategory=person)(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2))"
foreach ($i in $x)
$getcurrentupn = Get-CsUser -Identity $i.UserPrincipalName
$newaddress = "sip:" + $i.GivenName + "." + $i.Surname + "@domain.net"
Set-CsUser -Identity $getcurrentupn -SipAddress $newaddress
I'd suggest testing this first as it does iterate through AD or at least changing the Get-AdUser filter to only search a specific OU with users you want to change. I tested this in my lab against a couple users and it appeared to work, but does error on
users that are not Lync enabled, so sorry about the lack of error handling.
If this helped you please click "Vote As Helpful" if it answered your question please click "Mark As Answer"
Georg Thomas | Lync MVP
Blog www.lynced.com.au | Twitter
@georgathomas

Similar Messages

  • Batch rename files preserving the original file name in metadata

    How can I batch rename files while preserving the original file name in metadata? (Don't want the old file name as part of the new file name)
    (Adobe CS Bridge can do this with some success, but I don't want to be dependant on this software. Results are inconsistent.)

    With a simple terminal script. More details needed, though.

  • Batch Rename - Two File Formats with Same Name

    Hi everyone!
    I'm having troubles using the batch rename function i Bridge CS5.
    I've got several pictures that I've captured in both jpeg and raw. When importing the pics with windows photo import they get the same name. This means that I've got one JPG and one RAW file which contains the "same" picture, and have same name as shown below:
    What I would like to do is to rename the pictures, but still have Bridge name the same pictures with the same name as shown below:
         IMG_1268.CR2          ->          Picture 2011 - 0001
         IMG_1268.JPG          ->          Picture 2011 - 0001
         IMG_1269.CR2          ->          Picture 2011 - 0002
         IMG_1269.JPG          ->          Picture 2011 - 0002
    Is this even possible? And if possible, how?
    Thanks in advance
    Martin

    Most things are possible and so is this..
    Make sure you do a test first by copying the files to a temp folder!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    First copy the script below and paste it into ExtendScript Toolkit (this gets installed with Photoshop)
    #target bridge
    var sels = app.document.selections;
    for(var a in sels){
    var f = decodeURI(sels[a].spec.name);
    var newName = "Picture 2011 - "+ zeroPad((f.match(/\d{4}/)[0]-1267).toString(),4)+ f.match(/\....$/);
    sels[a].spec.rename(newName);
    function zeroPad(n, s) {
       n = n.toString();
       while (n.length < s)  n = '0' + n;
       return n;
    Now open Bridge and select the files you want to rename, then run the above script from ExtendScript Toolkit.

  • Account Login Name has been changed

    I was wondering how my account name got changed from firstname_lastname to firstname.lastname?!?
    I know I did not change it and I cannot find any help on this topic nor am I able to find a direct customer support email address .... so I am posting this problem here
    I'd appreciate any help that anyone can lend
    Thanks in advance

    can you try to sign out or logout first, then login again using your "firstname_lastname" (username) and password combination?  
    IF YOU FOUND OUR POST USEFUL THEN PLEASE GIVE "KUDOS". IF IT HELPED TO FIX YOUR ISSUE PLEASE MARK IT AS A "SOLUTION" TO HELP OTHERS. THANKS!
    ALTERNATIVE SKYPE DOWNLOAD LINKS | HOW TO RECORD SKYPE VIDEO CALLS | HOW TO HANDLE SUSPICIOS CALLS AND MESSAGES
    SEE MORE TIPS, TRICKS, TUTORIALS AND UPDATES in
    | skypefordummies.blogspot.com | 

  • Making user account logins case sensitive?

    Hi, just a quick question. Is it possible to make a user account login name case sensitive? Currently I can log on using upper or lower case for the login name however I would rather only the exact login name could be used.
    Thanks

    I had already answered with example.
    Re: Making user account logins/passwords case sensitive?

  • Change account action names

    Hi All,
    Is there a way to change the user and account action names that show up in the admin/configurator pages. For example New xxx User instead of new user in the drop down menu.
    Thanks,

    You can do that by changing the property file waveset.properties or WPMessages_en.properties (which ever is applicable) and setting the the desired value for the following property
    UI_USERAPPLETTABLE_NEW_USER=New xxx User
    Or you can create your own custom catalog and put same value in that.
    Regards,
    Suren

  • Login Names always display

    Hello!I'm unsure if this is an issue or a feature. Skype shows login names instead of display names unless I have them added. As an example, supposing a user has the login name example000, and the display name The Best Example, it defaults to showing example000. To get it to display The Best Example, I must add the user to my contacts. I am in a couple group chats and haven't added everyone. It seems everyone else defaults to seeing display names. Is there some setting I'm missing, since I went through Options and failed to find a solution myself? I'd prefer to default to seeing display names instead of login names - it's hard to keep track of who's who. I did think it was an issue with my settings and reset everything, but it still continues to show login names. I tried uninstalling and reinstalling Skype too, but the issue remains. Can someone help me? Thanks!

    Hi Ashok,
    I wouldn't change the users logon name, I would instead create an application item which is set to the user's freindly name on login.
    This could be displayed as a navigation bar entry, but as navigation bar entries are by definition navigation links, this could get confusing if it doesn't actually link to anything. it would probably be better if you changed the template to display the application item next to the navigation bar entries.
    Andre

  • I had renamed my user login name and assumed that there will be no change in the settings and files. When I login with the new profile name everything is gone. How can I get back all my files and settings?

    I had renamed my user login name and assumed that there will be no change in the settings and files. When I login with the new profile name everything is gone. How can I get back all my files and settings? Please help. Thanks.

    You should have asked this before you tried: Changing username or short name- User Account and Short Name- OS X- How to change user account name or home directory name.

  • PowerShell Script Get the User's Active Directory Fully Qualified Login Name for Specific Locked Out Accounts

    I have a script which displays locked out accounts. It works great.
    I'd like to display the fully qualified Active Directory Login Name instead of the LastName, First Name:
    Example: Davis, Susan
    Want instead: Domain\Susan.Davis
    I'd also like to include an additional filter to look for only Domain\Susan.Davis OR Domain\Robin.Givens
    Here is my script:
    $objDomain = New-Object System.DirectoryServices.DirectoryEntry
    $objSearcher = New-Object System.DirectoryServices.DirectorySearcher
    $objSearcher.SearchRoot = $objDomain
    $objSearcher.PageSize = 1000
    $objSearcher.Filter = "(&(objectClass=User)(lockoutTime>=1))"
    $colProplist = "name","samaccountname"
    foreach ($i in $colPropList){$objSearcher.PropertiesToLoad.Add($i) | out-null}
    $colResults = $objSearcher.FindAll()
    foreach ($objResult in $colResults) {
    $domainname = $objDomain.name
    $samaccountname = $objResult.Properties.samaccountname
    $user = [ADSI]"WinNT://$domainname/$samaccountname"
    $ADS_UF_LOCKOUT = 0x00000010
    if(($user.UserFlags.Value -band $ADS_UF_LOCKOUT) -eq $ADS_UF_LOCKOUT) {
    $objResult.Properties.name
    John
    John

    Sorry, I should have mentioned that the cmdlets I'm using are part of the Active Directory module. You'll need to install the RSAT (Win7+) to use them.
    If you'd rather stick with your DirectorySearcher methods instead of moving to the AD module, you can adjust your output by using something like this instead:
    if(($user.UserFlags.Value -band $ADS_UF_LOCKOUT) -eq $ADS_UF_LOCKOUT) {
    "$domainname\$($objResult.Properties.samaccountname)"
    $domainname might not be what you're expecting, just FYI.
    As for filtering, you can add to the if statement and check for your known usernames only.
    Don't retire TechNet! -
    (Don't give up yet - 12,700+ strong and growing)

  • Match user name (login name) and token

    Hi,
    I have setup the VDI 3.1 POC evaluation using VMware. It is all working great.
    I had 2 other requirements put forth by management:
    1) The Windows desktops had to lock the screen when a user removed his/her smart card
    2) The card and the user had to be the same. IE. Joe shouldn't be able to use Tom's card to login as Joe.
    I fixed issue 1 by using the SRWC Lockscreen addon for SRSS found here: http://wiki.sun-rays.org/index.php/How_To_Section#Sun_Ray_Connector_Lockscreen
    However, I cannot seem to fix item 2.
    It would seem that this functionality is/should be already builtin. I specified only registered tokens can attach and I registered the appropriate tokens. Then in the VDI Web interface, I specified that Token 1 belongs to Tom and Token 2 belongs to Joe.
    However, if I stick in Token 2 card, the login name comes up as Joe (good), but I can change the name to Tom and then login as Tom.
    Management doesn't want users who have lost their card to borrow someone else's to get in - they need to report the card lost/stolen and get a new one. This makes sense. However, the system doesn't seem to have any restrictions on this.
    What is the point of registering a specific token against a specific user without any enforcement? Seems like the system is broken. It really only functions as a suggestion of what user they should login as.
    Is there some way to correct this or implement this functionality?
    Thanks,
    Jim Nickel
    Jim

    If you really want to change the behavior of the login dialog, then I am afraid that can not be done without some code changes.
    What you could do as an alternative is to assign the desktops directly to the token(s), instead of assigning them to the user. Thus demonstrating that Joe/Tom can not access their desktops without having the right smart card. I know that this is not exactly what you want, but maybe that is sufficient for your demo.
    So to be precise here:
    1. The smart card of Joe (token A) should be assigned to desktop A (or alternatively to desktop pool A) using the Sun VDI admin UI.
    2. The smart card of Tom (token B) should be assigned to desktop B (or alternatively to desktop pool B).
    3. In addition you should configure these desktops that desktop A has only an account for Joe, and desktop B has only an account for Tom.
    If Tom uses the smart card of Joe (token A), he can still login into VDI but then he will not be able to access desktop B - instead he will be offered desktop A. However, the automatic login into the desktop's Windows OS will then not work, because the desktop does not have an account for Tom.
    As stated, not exactly what you want, but just to present an alternative here.
    - Klaus

  • Script for rename the pictures name as login names

    I have staff pictures (100+) and pictures name as ID of staff. But I want to rename all with login names. any idea of writing a script?
    Best
    lasantha

    Hi Lasantha,
    Please refer to the following post related to renaming user profile thumbnail.
    https://blogs.blackmarble.co.uk/blogs/rhepworth/post/2010/07/29/powershell-script-to-rename-files-for-use-as-sharepoint-2010-user-profile-thumbnails.aspx
    Please don't forget to mark it answered, if your problem resolved or helpful.

  • Set "peoples or groups" field with current user "login name" in sharepoint list form using javascript

    hi friends
    i am trying to set peoples or groups field in sharepoint  list form with current user login name
    here my code
    <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.js"></script>
    <script type="text/javascript">
    $(document).ready(function NewItemView () {
    var currentUser;
        if (SP.ClientContext != null) {
          SP.SOD.executeOrDelayUntilScriptLoaded(getCurrentUser, 'SP.js');
        else {
          SP.SOD.executeFunc('sp.js', null, getCurrentUser);
        function getCurrentUser() {
          var context = new SP.ClientContext.get_current();
          var web = context.get_web();
          currentUser = web.get_currentUser();
          context.load(currentUser);
          context.executeQueryAsync(onSuccessMethod, onRequestFail);
        function onSuccessMethod(sender, args) {
          var account = currentUser.get_loginName();
          var accountEmail = currentUser.get_email();
          var currentUserAccount = account.substring(account.indexOf("|") + 1);
        SetAndResolvePeoplePicker("requester",account);
    // This function runs if the executeQueryAsync call fails.
        function onRequestFail(sender, args) {
          alert('request failed' + args.get_message() + '\n' + args.get_stackTrace());
     function SetAndResolvePeoplePicker(fieldName, userAccountName) {
       var controlName = fieldName;
        var peoplePickerDiv = $("[id$='ClientPeoplePicker'][title='" + controlName + "']");
        var peoplePickerEditor = peoplePickerDiv.find("[title='" + controlName + "']");
        var spPeoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[peoplePickerDiv[0].id];
        peoplePickerEditor.val(userAccountName);
        spPeoplePicker.AddUnresolvedUserFromEditor(true);
    </script>
    but it is not working
    please help me

    Hi,
    According to your post, my understanding is that you wanted to set "peoples or groups" field with current user "login name" in SharePoint list form using JavaScript.
    To set "peoples or groups" field with current user "login name”,  you can use the below code:
    <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.js"></script>
    <script type="text/javascript">
    function SetPickerValue(pickerid, key, dispval) {
    var xml = '<Entities Append="False" Error="" Separator=";" MaxHeight="3">';
    xml = xml + PreparePickerEntityXml(key, dispval);
    xml = xml + '</Entities>';
    EntityEditorCallback(xml, pickerid, true);
    function PreparePickerEntityXml(key, dispval) {
    return '<Entity Key="' + key + '" DisplayText="' + dispval + '" IsResolved="True" Description="' + key + '"><MultipleMatches /></Entity>';
    function GetCurrentUserAndInsertIntoUserField() {
    var context = new SP.ClientContext.get_current();
    var web = context.get_web();
    this._currentUser = web.get_currentUser();
    context.load(this._currentUser);
    context.executeQueryAsync(Function.createDelegate(this, this.onSuccess),
    Function.createDelegate(this, this.onFailure));
    function onSuccess(sender, args) {
    SetPickerValue('ctl00_m_g_99f3303a_dffa_4436_8bfa_3511d9ffddc0_ctl00_ctl05_ctl01_ctl00_ctl00_ctl04_ctl00_ctl00_UserField', this._currentUser.get_loginName(),
    this._currentUser.get_title());
    function onFaiure(sender, args) {
    alert(args.get_message() + ' ' + args.get_stackTrace());
    ExecuteOrDelayUntilScriptLoaded(GetCurrentUserAndInsertIntoUserField, "sp.js");
    </script>
    More information:
    http://alexeybbb.blogspot.com/2012/10/sharepoint-set-peoplepicker-via-js.html
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • What is the default admin user account login id and password in Windows 8?

    Hi all,
    The current admin acccount in Windows 8 system are changed to Standard and no other Admin account is available in the system.
    What is the default admin user account login id and password in Windows 8?
    Or 
    Is there way to change the User role for the account?
    Please use Marked as Answer if my post solved your problem and use
    Vote As Helpful if a post was useful.

    I am able to login as a Normal user, can not login as administrator.Hence can not install any software or change my user settings or create a new user.
    What is the default admin password. How can i reset it form my user account
    C:\Users\Amit>net user Administrator
    User name                    Administrator
    Full Name
    Comment                      Built-in account for administering the computer/domain
    User's comment
    Country/region code          000 (System Default)
    Account active               No
    Account expires              Never
    Password last set            7/26/2012 12:57:03 PM
    Password expires             Never
    Password changeable          7/26/2012 12:57:03 PM
    Password required            Yes
    User may change password     Yes
    Workstations allowed         All
    Logon script
    User profile
    Home directory
    Last logon                   9/16/2013 1:16:30 PM
    Logon hours allowed          All
    Local Group Memberships      *Administrators
    Global Group memberships     *None
    The command completed successfully.

  • Cannot create or rename a user account in Windows 7 HP x64

    Hi. I have Windows 7 Home Premium x64 with one single account with Administrator rights (it's been set up in the computer shop).
    It turned out that I cannot create a new user account with it. I try to create one from Control Panel / User accounts menu / Manage other user account. It asks me to enter a name of the account and its kind, after it is done and Create button is pressed
    it returns to the User accounts list, which stays blanc (no account created). No error messages or warnings.
    I cannot even just change the name of my exsisting account, it looks almost the same: it asks for a new name and when the the name is typed in and Rename button is pressed it returns to the previuos screen where I can see that the name remains unrenamed.
    The only thing I can do with my account is to change its image for Logon screen. :)
    Please help me to fix this issue.

    Hi....  I have the same problem with my laptop and my netbook. Same OS in my laptop and Win7 Starter in my netbook.
    The only way I found to address this issue was as following:
    - Start your computer in 'Safe Mode'
    - Logon as 'Administrator' (preferred, but also works with all local users)
    - Go to control panel and 'User Accounts'
    - Create the new user with administrator rights
    - Then close Admin session
    - Logon as the new user
    - Once logged on, and desktop and icons shows up for you, is done.
    - Then, close new user session or restart your computer normally
    This started to happen to me after a Windows 7 update for 'Service Pack 1'.
    It seems to be an error in this update because the normal process to create a new user only creates the name in the list but no folders and other files necessary to start sessions. The profile is not fully created by the normal process. Then you need to
    start the process in SAFE MODE, because it only loads the very basic functions for the OS, no drivers, no services, no antivirus....
    Hope this can help...!
    Thanks.
    A.V.

  • Suddenly user account login requested, but was newer created (OS X 10.5.6), how to get access again

    suddenly user account login requested, but was newer created (OS X 10.5.6), how to get access again?

    No account ever created, or what?
    If not 1.6 Server, then...
    Reset OS X Password Without an OS X CD...
    http://theappleblog.com/2008/06/22/reset-os-x-password-without-an-os-x-cd/
    Admin Hack...
    http://www.hackmac.org/?q=node/4
    Starts up like the first time you buy a new Mac, but after filling in all that info again, you should have access to the computer and the other Users & files will still be there... give the new User a different name than an existing one.
    http://www.macyourself.com/2009/08/03/how-to-reset-your-mac-os-x-password-withou t-an-installer-disc/

Maybe you are looking for

  • Procedure entry point sqlite3_stmt_readonly could not be located in the dynamic link library mozsqlite3.dll

    When I launch Firefox, I get the error message listed in the "question". I can click on the "OK" button, but Firefox doesn't start.

  • Database link error - ORA-01017

    Hello all. I have a problem with a database link. I create the link like this - create database link agenda connect to user1 identified by user1pw using 'agenda' ... I have read where you need to make the link name the same as the Net8 name. I create

  • CMD/plus not retained between pages

    On the previous version of Safari, doing CMD + to zoom a couple of times at start of session enabled me to read the text easier. With the new Safari under Mavericks, although this still works, I'm having to do it every time I go to a new page - where

  • Smart Sharpen Preview Inaccurate

    When I use smart sharpen, the preview box shows the image will be sharper than it actually makes it when commited. Actually, even before it's commited I can see by moving the Sharpen Box over and looking at the image in its main window... I press P t

  • How can I turn off iMessage on my iPhone from my Mac?

    My iPhone recently broke and I was forced to get an android (I absolutely hate it) I don't have an upgrade till June/October of next year so I'm stuck with this terrible phone for awhile. However I can't recieve texts from people with iPhones because